mldonkey-commits
[Top][All Lists]
Advanced

[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: Mon, 29 Aug 2005 10:52:50 -0400

Index: mldonkey/src/config/mingw/os_stubs_c.c
diff -u mldonkey/src/config/mingw/os_stubs_c.c:1.9 
mldonkey/src/config/mingw/os_stubs_c.c:1.10
--- mldonkey/src/config/mingw/os_stubs_c.c:1.9  Sun Aug 28 11:01:29 2005
+++ mldonkey/src/config/mingw/os_stubs_c.c      Mon Aug 29 14:52:49 2005
@@ -37,12 +37,20 @@
   return numread;
 }
 
+#include <winioctl.h>
+
 void os_ftruncate(OS_FD fd, OFF_T size)
 {
   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();
+       }
   curpos = SetFilePointer (fd, 0, NULL, FILE_CURRENT);
   if (curpos == 0xFFFFFFFF
       || SetFilePointer (fd, ofs_low, &ofs_high, FILE_BEGIN) == 0xFFFFFFFF




reply via email to

[Prev in Thread] Current Thread [Next in Thread]