From 0b5888ed22095183612a4ea6cee5bb79b12ae38e Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 16 Jan 2017 01:00:10 +0100 Subject: [PATCH] cond.c: Use utimensat() instead of utime() for nanosecond precision We have repeatedly seen use-cases when sub-second resolution for updatating the mtime of files have been needed. Yes, all those cases have been Autobots. Signed-off-by: Joachim Nilsson --- cond-w.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cond-w.c b/cond-w.c index 232afef0..efb1b263 100644 --- a/cond-w.c +++ b/cond-w.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "finit.h" #include "cond.h" @@ -50,7 +50,7 @@ int cond_set_path(const char *path, enum cond_state new) return 0; } touch(path); - utime(path, NULL); + utimensat(0, path, NULL, 0); break; case COND_OFF: