summaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
Diffstat (limited to 'src/time')
-rw-r--r--src/time/utime.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/time/utime.c b/src/time/utime.c
index 856315b4..b2b5741b 100644
--- a/src/time/utime.c
+++ b/src/time/utime.c
@@ -1,7 +1,14 @@
#include <utime.h>
+#include <sys/time.h>
#include "syscall.h"
int utime(const char *path, const struct utimbuf *times)
{
- return syscall(SYS_utime, path, times);
+ if (times) {
+ struct timeval tv[2] = {
+ { .tv_sec = times->actime },
+ { .tv_sec = times->modtime } };
+ return syscall(SYS_utimes, path, tv);
+ }
+ return syscall(SYS_utimes, path, 0);
}