summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-16 15:37:52 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-16 15:37:52 +0200
commitf61448083198dc0e4e0d19a916bcd478336cc85d (patch)
treee9325f22f715d5788b46e5ecbeb6e2fc94a73010 /src/util.c
parent6e200d55ae538fc29360cdaa9863f30cdddf58f3 (diff)
systemctl: add support for delayed shutdown, similar to sysv in style
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
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",