diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | src/tool_operate.c | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 9cc1eca27..5ef731260 100644 --- a/configure.ac +++ b/configure.ac @@ -3294,7 +3294,8 @@ AC_CHECK_FUNCS([fork \ setmode \ setrlimit \ uname \ - utime + utime \ + utimes ],[ ],[ func="$ac_func" 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; |