* 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> | 2003-05-26  Corinna Vinschen  <corinna@vinschen.de> | ||||||
| 
 | 
 | ||||||
| 	* fhandler.cc (is_at_eof): Fix conditional.  Use INVALID_FILE_SIZE | 	* 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); |   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; |   DWORD spc, bps, availc, freec, totalc; | ||||||
| 
 | 
 | ||||||
|   if (!GetDiskFreeSpace (root, &spc, &bps, &freec, &totalc)) |   if (!GetDiskFreeSpace (root, &spc, &bps, &freec, &totalc)) | ||||||
|  | @ -1884,9 +1889,7 @@ statfs (const char *fname, struct statfs *sfs) | ||||||
|       return -1; |       return -1; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   ULARGE_INTEGER availb, freeb, totalb; |   if (status) | ||||||
| 
 |  | ||||||
|   if (GetDiskFreeSpaceEx (root, &availb, &totalb, &freeb)) |  | ||||||
|     { |     { | ||||||
|       availc = availb.QuadPart / (spc*bps); |       availc = availb.QuadPart / (spc*bps); | ||||||
|       totalc = totalb.QuadPart / (spc*bps); |       totalc = totalb.QuadPart / (spc*bps); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue