Revert changes in daemonize.c from commit 22d6f39e7f
This commit is contained in:
parent
83a79ec381
commit
15bb297fbb
1 changed files with 14 additions and 3 deletions
|
@ -142,9 +142,20 @@ lws_daemonize(const char *_lock_path)
|
|||
exit(9);
|
||||
}
|
||||
|
||||
/* If we got a good PID, then we can exit the parent process. */
|
||||
if (pid_daemon > 0)
|
||||
exit(0);
|
||||
/* If we got a good PID, then we can exit the parent process. */
|
||||
if (pid_daemon > 0) {
|
||||
|
||||
/*
|
||||
* Wait for confirmation signal from the child via
|
||||
* SIGCHILD / USR1, or for two seconds to elapse
|
||||
* (SIGALRM). pause() should not return.
|
||||
*/
|
||||
alarm(2);
|
||||
|
||||
pause();
|
||||
/* should not be reachable */
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* At this point we are executing as the child process */
|
||||
parent = getppid();
|
||||
|
|
Loading…
Add table
Reference in a new issue