diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_operate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c index 724826c8e..5a129bd34 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -231,6 +231,17 @@ static void setfiletime(long filetime, const char *filename, "CreateFile failed: GetLastError %u\n", filetime, GetLastError()); } + +#elif defined(HAVE_UTIMES) + struct timeval times[2]; + times[0].tv_sec = times[1].tv_sec = filetime; + times[0].tv_usec = times[1].tv_usec = 0; + if(utimes(filename, times)) { + fprintf(error_stream, + "Failed to set filetime %ld on outfile: errno %d\n", + filetime, errno); + } + #elif defined(HAVE_UTIME) struct utimbuf times; times.actime = (time_t)filetime; |