gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 36/254: tool_operate: use utimes instead of obsoles


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 36/254: tool_operate: use utimes instead of obsolescent utime when available
Date: Sat, 17 Jun 2017 16:51:08 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.

commit 4da846a41ed19f2a81357d30cf210bf4616a8798
Author: Dan Fandrich <address@hidden>
AuthorDate: Thu Apr 27 01:24:07 2017 +0200

    tool_operate: use utimes instead of obsolescent utime when available
---
 configure.ac       |  3 ++-
 src/tool_operate.c | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

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;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]