+2003-05-26 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * syscalls.cc (statfs): Call GetDiskFreeSpaceEx before GetDiskFreeSpace.
+
2003-05-26 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (is_at_eof): Fix conditional. Use INVALID_FILE_SIZE
syscall_printf ("statfs %s", root);
+ /* GetDiskFreeSpaceEx must be called before GetDiskFreeSpace on
+ WinME, to avoid the MS KB 314417 bug */
+ ULARGE_INTEGER availb, freeb, totalb;
+ BOOL status = GetDiskFreeSpaceEx (root, &availb, &totalb, &freeb);
+
DWORD spc, bps, availc, freec, totalc;
if (!GetDiskFreeSpace (root, &spc, &bps, &freec, &totalc))
return -1;
}
- ULARGE_INTEGER availb, freeb, totalb;
-
- if (GetDiskFreeSpaceEx (root, &availb, &totalb, &freeb))
+ if (status)
{
availc = availb.QuadPart / (spc*bps);
totalc = totalb.QuadPart / (spc*bps);