Fix bug: Parent process exits but child process didn't

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao committed 2021-01-04 15:48:09 +08:00
1 parent db85c135cb
commit 8c2e9c3a57
1 file changed
+3
+3
View File
@@ -32,6 +32,7 @@
#include <dlfcn.h>
#endif
#include <sys/sysinfo.h>
#include <sys/prctl.h>
#include "uhttpd_internal.h"
#include "connection.h"
@@ -202,6 +203,8 @@ static void uh_start_worker(struct uh_server *srv, int n)
uh_log_err("fork: %s\n", strerror(errno));
return;
case 0:
prctl(PR_SET_PDEATHSIG, SIGKILL);
ev_loop_fork(srvi->loop);
if (srvi->reuseport) {