summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-01-27 08:17:38 +0000
committerMike Frysinger <vapier@gentoo.org>2007-01-27 08:17:38 +0000
commitf57dbfbd37cc24fcf75a4088bce7b341d51041e9 (patch)
treee43f5486d95536c2665e9449dacf7ab96ce27f8e
parent17963cfdfa1aeb9b266824a8dc063eed8b0b4f9b (diff)
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
-rw-r--r--libc/sysdeps/linux/common/utime.c7
1 files changed, 1 insertions, 6 deletions
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)