Create pidfile iff daemon mode enabled.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2022-10-27 13:45:49 +02:00
parent c63cbec26d
commit d3f99f21e6

View File

@@ -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)