* syscalls.cc (statfs): Call GetDiskFreeSpaceEx before GetDiskFreeSpace.
This commit is contained in:
parent
0372ad9f11
commit
ada0376f64
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue