Daemon: simplify nested "if"
This commit is contained in:
parent
0b1ad27ba8
commit
20ffedc745
@ -106,11 +106,10 @@ daemonize_set_user(void)
|
||||
return;
|
||||
|
||||
/* set gid */
|
||||
if (user_gid != (gid_t)-1 && user_gid != getgid()) {
|
||||
if (setgid(user_gid) == -1) {
|
||||
FormatFatalSystemError("Failed to set group %d",
|
||||
(int)user_gid);
|
||||
}
|
||||
if (user_gid != (gid_t)-1 && user_gid != getgid() &&
|
||||
setgid(user_gid) == -1) {
|
||||
FormatFatalSystemError("Failed to set group %d",
|
||||
(int)user_gid);
|
||||
}
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
Loading…
Reference in New Issue
Block a user