daemon: return early from daemonize_set_user()
If no "user" is configured, return from daemonize_set_user(). Save one level of indent.
This commit is contained in:
parent
98994c5939
commit
92c203d705
@ -100,7 +100,9 @@ void
|
||||
daemonize_set_user(void)
|
||||
{
|
||||
#ifndef WIN32
|
||||
if (user_name != NULL) {
|
||||
if (user_name == NULL)
|
||||
return;
|
||||
|
||||
/* get uid */
|
||||
if (setgid(user_gid) == -1) {
|
||||
g_error("cannot setgid for user \"%s\": %s",
|
||||
@ -122,7 +124,6 @@ daemonize_set_user(void)
|
||||
g_error("cannot change to uid of user \"%s\": %s",
|
||||
user_name, g_strerror(errno));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user