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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-01-16 01:00:10 +01:00
1 parent 4321038518
commit 0b5888ed22
1 file changed
+2 -2
+2 -2
View File
@@ -24,7 +24,7 @@
#include <libgen.h>
#include <lite/lite.h>
#include <stdio.h>
#include <utime.h>
#include <sys/stat.h>
#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: