[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/config/mingw/os_stubs_c.c
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/config/mingw/os_stubs_c.c |
Date: |
Fri, 02 Sep 2005 18:39:34 -0400 |
Index: mldonkey/src/config/mingw/os_stubs_c.c
diff -u mldonkey/src/config/mingw/os_stubs_c.c:1.10
mldonkey/src/config/mingw/os_stubs_c.c:1.11
--- mldonkey/src/config/mingw/os_stubs_c.c:1.10 Mon Aug 29 14:52:49 2005
+++ mldonkey/src/config/mingw/os_stubs_c.c Fri Sep 2 22:39:33 2005
@@ -20,7 +20,7 @@
extern void enter_blocking_section();
extern void leave_blocking_section();
-extern ssize_t os_read(OS_FD fd, char *buf, size_t len)
+extern ssize_t os_read(OS_FD fd, char *buf, size_t len)
{
DWORD numread;
BOOL ret;
@@ -37,20 +37,22 @@
return numread;
}
-#include <winioctl.h>
-
-void os_ftruncate(OS_FD fd, OFF_T size)
+#include <winioctl.h>
+
+void os_ftruncate(OS_FD fd, OFF_T size, /* bool */ int sparse)
{
uint curpos;
long ofs_low = (long) size;
long ofs_high = (long) (size >> 32);
- DWORD dw;
- BOOL bRet = DeviceIoControl(fd, FSCTL_SET_SPARSE, NULL, 0, NULL, 0,
&dw, NULL);
- if (!bRet) {
- // No sparse files for you, sucker...
- // DWORD err = GetLastError();
- }
+ if (sparse) {
+ DWORD dw;
+ BOOL bRet = DeviceIoControl(fd, FSCTL_SET_SPARSE, NULL, 0, NULL, 0,
&dw, NULL);
+ if (!bRet) {
+ // No sparse files for you, sucker...
+ // DWORD err = GetLastError();
+ }
+ }
curpos = SetFilePointer (fd, 0, NULL, FILE_CURRENT);
if (curpos == 0xFFFFFFFF
|| SetFilePointer (fd, ofs_low, &ofs_high, FILE_BEGIN) == 0xFFFFFFFF
@@ -98,7 +100,7 @@
}
}
-OFF_T os_lseek(OS_FD fd, OFF_T ofs, int cmd)
+OFF_T os_lseek(OS_FD fd, OFF_T ofs, int cmd)
{
long ret;
long ofs_low = ofs;
@@ -113,7 +115,7 @@
uerror("os_lseek", Nothing);
}
}
- return ((OFF_T) ofs_high << 32 | ret);
+ return ((OFF_T) ofs_high << 32 | ret);
}
#include <winsock2.h>
- [Mldonkey-commits] Changes to mldonkey/src/config/mingw/os_stubs_c.c,
mldonkey-commits <=