Commit fe5a3a24 authored by Alexandre Julliard's avatar Alexandre Julliard

Better fallback in SetFileTime when futimes is missing.

parent f8371796
......@@ -1708,14 +1708,14 @@ BOOL WINAPI SetFileTime( HANDLE hFile,
const FILETIME *atime,
const FILETIME *mtime )
{
#ifdef HAVE_FUTIMES
BOOL ret = FALSE;
NTSTATUS status;
int fd;
ULONGLONG sec, nsec;
if (!(status = wine_server_handle_to_fd( hFile, GENERIC_WRITE, &fd, NULL, NULL )))
{
#ifdef HAVE_FUTIMES
ULONGLONG sec, nsec;
struct timeval tv[2];
if (!atime || !mtime)
......@@ -1747,14 +1747,13 @@ BOOL WINAPI SetFileTime( HANDLE hFile,
if (!futimes( fd, tv )) ret = TRUE;
else FILE_SetDosError();
#else
ret = TRUE; /* pretend it succeeded */
#endif
wine_server_release_fd( hFile, fd );
}
else SetLastError( RtlNtStatusToDosError(status) );
return ret;
#else
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
#endif /* HAVE_FUTIMES */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment