* fhandler.cc (fhandler_base::fsync): Ignore ERROR_INVALID_FUNCTION
error from FlushFileBuffers().
This commit is contained in:
parent
2daa7e07ce
commit
0e126cb141
@ -1,3 +1,8 @@
|
||||
2011-02-01 Christian Franke <franke@computer.org>
|
||||
|
||||
* fhandler.cc (fhandler_base::fsync): Ignore ERROR_INVALID_FUNCTION
|
||||
error from FlushFileBuffers().
|
||||
|
||||
2011-01-31 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* syscalls.cc (utmp_data): Fix potential buffer overflow.
|
||||
|
@ -1588,7 +1588,14 @@ fhandler_base::fsync ()
|
||||
return 0;
|
||||
if (FlushFileBuffers (get_handle ()))
|
||||
return 0;
|
||||
__seterrno ();
|
||||
|
||||
/* Ignore ERROR_INVALID_FUNCTION because FlushFileBuffers() always fails
|
||||
with this code on raw devices which are unbuffered by default. */
|
||||
DWORD errcode = GetLastError();
|
||||
if (errcode == ERROR_INVALID_FUNCTION)
|
||||
return 0;
|
||||
|
||||
__seterrno_from_win_error (errcode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user