* syscalls.cc (statfs): Call GetDiskFreeSpaceEx before GetDiskFreeSpace.

This commit is contained in:
Corinna Vinschen 2003-05-26 16:52:58 +00:00
parent 0372ad9f11
commit ada0376f64
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -1876,6 +1876,11 @@ statfs (const char *fname, struct statfs *sfs)
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))
@ -1884,9 +1889,7 @@ statfs (const char *fname, struct statfs *sfs)
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);