chiark / gitweb /
man: document new shutdown features
[elogind.git] / src / util.c
index c0b63dd574ba911a4d9f282d5184a21785a8fbb6..bc227f52d59e4ff7269f5716d8d2b2df8c806a7c 100644 (file)
@@ -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",