mirror of
https://github.com/troglobit/finit.git
synced 2026-10-15 10:29:35 +00:00
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:
1 parent
4321038518
commit
0b5888ed22
1 file changed
+2
-2
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user