aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-10-27 13:45:49 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-10-31 12:45:49 +0100
commitd3f99f21e6ab7c13286af5f37dafbe9cd76f2fad (patch)
tree918d58087336b0096d2cd783f00cd6c3f4796765 /utils.c
parentc63cbec26d9ab3aa3004c9969ec67315fecd28b1 (diff)
Create pidfile iff daemon mode enabled.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index fc0472b7c..7f6665d1a 100644
--- a/utils.c
+++ b/utils.c
@@ -197,7 +197,7 @@ int change_user_group(char const * const user,
return -errno;
}
}
- if (pidfile != NULL)
+ if (daemonize != 0 && pidfile != NULL)
{
errno = 0;
if (chown(pidfile, pwd->pw_uid, gid) != 0)