diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index c0b63dd574..bc227f52d5 100644 --- a/src/util.c +++ b/src/util.c @@ -2997,6 +2997,17 @@ void nss_disable_nscd(void) { log_debug("Cannot disable nscd."); } +int touch(const char *path) { + int fd; + + assert(path); + + if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666)) < 0) + return -errno; + + close_nointr_nofail(fd); + return 0; +} static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", |