diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-23 23:50:26 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-23 23:50:26 +0100 |
commit | a7ec737cbd4adc0123492a5b3c48978f56be0cd1 (patch) | |
tree | f292f46bb87af7f8c98447b78067d29c29130068 | |
parent | daemonise: user-private daemons (diff) | |
download | slibc-a7ec737cbd4adc0123492a5b3c48978f56be0cd1.tar.gz slibc-a7ec737cbd4adc0123492a5b3c48978f56be0cd1.tar.bz2 slibc-a7ec737cbd4adc0123492a5b3c48978f56be0cd1.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/unistd/daemonise.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unistd/daemonise.c b/src/unistd/daemonise.c index 7c415fa..3d4ab72 100644 --- a/src/unistd/daemonise.c +++ b/src/unistd/daemonise.c @@ -218,11 +218,11 @@ int daemonise(const char* name, int flags) /* Create PID file. */ if (flags & DAEMONISE_NO_PID_FILE) goto no_pid_file; - char* run = getenv("XDG_RUNTIME_DIR"); + run = getenv("XDG_RUNTIME_DIR"); if (run && *run) { pidpath = alloca(sizeof("/.pid") + (strlen(run) + strlen(name)) * sizeof(char)); - stpcpy(stpcpy(stpcpy(stpcpy(pidpath, run), "/", name), ".pid"); + stpcpy(stpcpy(stpcpy(stpcpy(pidpath, run), "/"), name), ".pid"); } else { @@ -234,7 +234,7 @@ int daemonise(const char* name, int flags) pid = getpid(); t (dprintf(fd, "%lli\n", (long long int)pid)) < 0; t (close(fd) && (errno != EINTR)); - no_pid_file: + no_pid_file: /* Redirect to '/dev/null'. */ if (flags & DAEMONISE_KEEP_STDERR) |