summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-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)