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:
Max Kellermann 2009-02-15 16:58:52 +01:00
parent 98994c5939
commit 92c203d705

View File

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