From f57dbfbd37cc24fcf75a4088bce7b341d51041e9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 27 Jan 2007 08:17:38 +0000 Subject: fix from blackfin repo: Jie Zhang writes: Passing NULL as the second argument to utimes () if the second argument to utime () is NULL as the kernel will take care of getting/setting current time --- libc/sysdeps/linux/common/utime.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'libc/sysdeps/linux/common/utime.c') diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c index b04a29f1a..6e35be2c1 100644 --- a/libc/sysdeps/linux/common/utime.c +++ b/libc/sysdeps/linux/common/utime.c @@ -30,13 +30,8 @@ int utime(const char *file, const struct utimbuf *times) timevals[1].tv_usec = 0L; timevals[0].tv_sec = (long int) times->actime; timevals[1].tv_sec = (long int) times->modtime; - } else { - if (gettimeofday(&timevals[0], NULL) < 0) { - return -1; - } - timevals[1] = timevals[0]; } - return utimes(file, timevals); + return utimes(file, times ? timevals : NULL); } #endif libc_hidden_def(utime) -- cgit v1.2.3