From: Ulrich Drepper Date: Thu, 8 Aug 2002 07:02:20 +0000 (+0000) Subject: If TIMES is NULL pass it through to utimes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4999f41598e9a97e174cf1b671977951f14739f1;p=thirdparty%2Fglibc.git If TIMES is NULL pass it through to utimes. --- diff --git a/sysdeps/unix/utime.c b/sysdeps/unix/utime.c index 4b1f23a497b..01099cb1ae5 100644 --- a/sysdeps/unix/utime.c +++ b/sysdeps/unix/utime.c @@ -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); }