From efc0592961cb3b9e93cc88952d41567c2e9371c8 Mon Sep 17 00:00:00 2001 From: Ryan Rorison Date: Fri, 15 Dec 2023 15:01:07 -0800 Subject: [PATCH] Fix log child exiting with debug disabled --- src/service.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/service.c b/src/service.c index 1ee54e5a..378c14e4 100644 --- a/src/service.c +++ b/src/service.c @@ -330,14 +330,15 @@ static int lredirect(svc_t *svc) snprintf(rot, sizeof(rot), "%d:%d", logfile_size_max, logfile_count_max); snprintf(pid, sizeof(pid), "%d", svc_pid); - execlp("logger", "logger", "-f", svc->log.file, "-b", "-t", tag, "-p", prio, debug ? "-s" : "", "-I", pid, "-r", rot, NULL); + execlp("logger", "logger", "-f", svc->log.file, "-b", "-t", tag, "-p", prio, "-I", pid, "-r", rot, debug ? "-s" : NULL, NULL); } else { char sz[20], num[3]; snprintf(sz, sizeof(sz), "%d", logfile_size_max); snprintf(num, sizeof(num), "%d", logfile_count_max); - execlp(_PATH_LOGIT, "logit", "-f", svc->log.file, "-n", sz, "-r", num, debug ? "-s" : "", NULL); + execlp(_PATH_LOGIT, "logit", "-f", svc->log.file, "-n", sz, "-r", num, debug ? "-s" : NULL, NULL); + } _exit(1); } @@ -351,9 +352,9 @@ static int lredirect(svc_t *svc) char pid[16]; snprintf(pid, sizeof(pid), "%d", svc_pid); - execlp("logger", "logger", "-t", tag, "-p", prio, debug ? "-s" : "", "-I", pid, NULL); + execlp("logger", "logger", "-t", tag, "-p", prio, "-I", pid, debug ? "-s" : NULL, NULL); } else { - execlp(_PATH_LOGIT, "logit", "-t", tag, "-p", prio, debug ? "-s" : "", NULL); + execlp(_PATH_LOGIT, "logit", "-t", tag, "-p", prio, debug ? "-s" : NULL, NULL); } _exit(1); }