]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
If TIMES is NULL pass it through to utimes.
authorUlrich Drepper <drepper@redhat.com>
Thu, 8 Aug 2002 07:02:20 +0000 (07:02 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 8 Aug 2002 07:02:20 +0000 (07:02 +0000)
sysdeps/unix/utime.c

index 4b1f23a497b1c4bb034e41c15e303a6f46249b5e..01099cb1ae53bd267b422a4e7de40ba3aa068e06 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1997, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ utime (file, times)
      const char *file;
      const struct utimbuf *times;
 {
-  struct timeval timevals[2];
+  struct timeval timevals[2], *tvp;
 
   if (times != NULL)
     {
@@ -39,13 +39,10 @@ utime (file, times)
       timevals[0].tv_usec = 0L;
       timevals[1].tv_sec = (long int) times->modtime;
       timevals[1].tv_usec = 0L;
+      tvp = timevals;
     }
   else
-    {
-      if (__gettimeofday (&timevals[0], NULL) < 0)
-       return -1;
-      timevals[1] = timevals[0];
-    }
+    tvp = NULL;
 
-  return __utimes (file, timevals);
+  return __utimes (file, tvp);
 }