From a7ec737cbd4adc0123492a5b3c48978f56be0cd1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 23 Dec 2015 23:50:26 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/unistd/daemonise.c | 6 +++--- 1 file 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) -- cgit v1.2.3-70-g09d2