Commit 20ffedc7 authored by Max Kellermann's avatar Max Kellermann

Daemon: simplify nested "if"

parent 0b1ad27b
...@@ -106,12 +106,11 @@ daemonize_set_user(void) ...@@ -106,12 +106,11 @@ daemonize_set_user(void)
return; return;
/* set gid */ /* set gid */
if (user_gid != (gid_t)-1 && user_gid != getgid()) { if (user_gid != (gid_t)-1 && user_gid != getgid() &&
if (setgid(user_gid) == -1) { setgid(user_gid) == -1) {
FormatFatalSystemError("Failed to set group %d", FormatFatalSystemError("Failed to set group %d",
(int)user_gid); (int)user_gid);
} }
}
#ifdef _BSD_SOURCE #ifdef _BSD_SOURCE
/* init suplementary groups /* init suplementary groups
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment