]> granicus.if.org Git - sudo/commitdiff
now use HAVE_UTIME_NULL
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 17 Jun 1995 23:12:54 +0000 (23:12 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 17 Jun 1995 23:12:54 +0000 (23:12 +0000)
utime.c

diff --git a/utime.c b/utime.c
index d90c80f4748a7bf962fa6bad35397ec25205f932..8918fb1fcdb75f9aea5bb5802d995160632ed95e 100644 (file)
--- a/utime.c
+++ b/utime.c
@@ -56,9 +56,9 @@ int utime(file, tvp)
     const char *file;                                  /* file to udpate */
     const struct utimbuf *utp;                         /* what to update to */
 {
-    if (upt) {
-       struct timeval tv[2];
+    struct timeval tv[2];
 
+    if (upt) {
        tv[0].tv_sec = ut.actime;
        tv[0].tv_usec = 0;
 
@@ -67,6 +67,13 @@ int utime(file, tvp)
 
        return(utimes(file, tv);
     } else {
+#ifdef HAVE_UTIME_NULL
        return(utimes(file, NULL);
+#else
+       tv[0].tv_sec = tv[1].tv_sec = time(NULL);
+       tv[0].tv_usec = tv[1].tv_usec = 0;
+
+       return(utimes(file, tv);
+#endif /* HAVE_UTIME_NULL */
     }
 }