Commit 25321297 authored by Max Kellermann's avatar Max Kellermann

daemon: don't fork twice to daemonize

To detach from the parent process, fork once and make the old process exit. No need to do that twice.
parent d8fc8ca7
......@@ -79,14 +79,6 @@ daemonize(Options *options)
g_error("problems setsid'ing");
}
fflush(NULL);
pid = fork();
if (pid > 0)
_exit(EXIT_SUCCESS);
else if (pid < 0) {
g_error("problems fork'ing for daemon!");
}
g_debug("daemonized!");
}
......
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