From c37afdfdf393261e18364aed52571d0a5b011044 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 24 May 2012 10:55:58 -0400 Subject: [PATCH] linux deprecated SYS_utime on some archs, so use SYS_utimes instead the old code could be kept for cases where SYS_utime is available, but it's not really worth the ifdef ugliness. and better to avoid deprecated stuff just in case the kernel devs ever get crazy enough to start removing it from archs where it was part of the ABI and breaking static bins... --- src/time/utime.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 +#include #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); } -- 2.25.1