X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ftime%2Futime.c;h=e7592b297809c817a2ec9ca4368be1f37147920b;hb=04335d9260c076cf4d9264bd93dd3b06c237a639;hp=b2b5741b32099a63b2b02ecb275377b6f9e32f23;hpb=c37afdfdf393261e18364aed52571d0a5b011044;p=musl diff --git a/src/time/utime.c b/src/time/utime.c index b2b5741b..e7592b29 100644 --- a/src/time/utime.c +++ b/src/time/utime.c @@ -1,14 +1,11 @@ #include -#include -#include "syscall.h" +#include +#include +#include int utime(const char *path, const struct utimbuf *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); + return utimensat(AT_FDCWD, path, times ? ((struct timespec [2]){ + { .tv_sec = times->actime }, { .tv_sec = times->modtime }}) + : 0, 0); }