forked from Mirrors/wine-wine
Better fallback in SetFileTime when futimes is missing.
parent
f837179645
commit
fe5a3a24c7
11
files/file.c
11
files/file.c
|
@ -1708,14 +1708,14 @@ BOOL WINAPI SetFileTime( HANDLE hFile,
|
||||||
const FILETIME *atime,
|
const FILETIME *atime,
|
||||||
const FILETIME *mtime )
|
const FILETIME *mtime )
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FUTIMES
|
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
int fd;
|
int fd;
|
||||||
ULONGLONG sec, nsec;
|
|
||||||
|
|
||||||
if (!(status = wine_server_handle_to_fd( hFile, GENERIC_WRITE, &fd, NULL, NULL )))
|
if (!(status = wine_server_handle_to_fd( hFile, GENERIC_WRITE, &fd, NULL, NULL )))
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_FUTIMES
|
||||||
|
ULONGLONG sec, nsec;
|
||||||
struct timeval tv[2];
|
struct timeval tv[2];
|
||||||
|
|
||||||
if (!atime || !mtime)
|
if (!atime || !mtime)
|
||||||
|
@ -1747,14 +1747,13 @@ BOOL WINAPI SetFileTime( HANDLE hFile,
|
||||||
|
|
||||||
if (!futimes( fd, tv )) ret = TRUE;
|
if (!futimes( fd, tv )) ret = TRUE;
|
||||||
else FILE_SetDosError();
|
else FILE_SetDosError();
|
||||||
|
#else
|
||||||
|
ret = TRUE; /* pretend it succeeded */
|
||||||
|
#endif
|
||||||
wine_server_release_fd( hFile, fd );
|
wine_server_release_fd( hFile, fd );
|
||||||
}
|
}
|
||||||
else SetLastError( RtlNtStatusToDosError(status) );
|
else SetLastError( RtlNtStatusToDosError(status) );
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
|
||||||
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
|
|
||||||
return FALSE;
|
|
||||||
#endif /* HAVE_FUTIMES */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue