__time_to_tm: initialize tm_zone and tm_gmtoff
[musl] / src / time / utime.c
index 56e9e13..b2b5741 100644 (file)
@@ -1,12 +1,14 @@
 #include <utime.h>
+#include <sys/time.h>
 #include "syscall.h"
 
 int utime(const char *path, const struct utimbuf *times)
 {
-       long ktimes[2];
        if (times) {
-               ktimes[0] = times->actime;
-               ktimes[1] = times->modtime;
+               struct timeval tv[2] = {
+                       { .tv_sec = times->actime },
+                       { .tv_sec = times->modtime } };
+               return syscall(SYS_utimes, path, tv);
        }
-       return syscall2(__NR_utime, (long)path, times ? (long)ktimes : 0);
+       return syscall(SYS_utimes, path, 0);
 }