* fhandler.cc (fhandler_base::fsync): Ignore ERROR_INVALID_FUNCTION

error from FlushFileBuffers().
This commit is contained in:
Corinna Vinschen 2011-02-01 08:46:48 +00:00
parent 2daa7e07ce
commit 0e126cb141
2 changed files with 13 additions and 1 deletions

View File

@ -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.

View File

@ -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;
}