From b57947114ec01e6899ef6b12eff305f1ed3987bc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 2 Sep 2021 12:05:33 +0900 Subject: [PATCH] fs-util: use futimens_opath() helper function --- src/basic/fs-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index cc8c5e1c3e..165dffbefa 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -412,11 +412,11 @@ int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gi timespec_store(&ts[0], stamp); ts[1] = ts[0]; - r = utimensat(AT_FDCWD, FORMAT_PROC_FD_PATH(fd), ts, 0); + r = futimens_opath(fd, ts); } else - r = utimensat(AT_FDCWD, FORMAT_PROC_FD_PATH(fd), NULL, 0); + r = futimens_opath(fd, NULL); if (r < 0 && ret >= 0) - return -errno; + return r; return ret; }