mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Restore SIGCHLD handler to SIG_DFL in CGI process
This commit is contained in:
1 parent
1eb719f2d9
commit
2cd4852321
1 file changed
+6
@@ -1395,6 +1395,12 @@ static pid_t spawn_process(struct mg_connection *conn, const char *prog,
|
|||||||
(void) close(fd_stdin);
|
(void) close(fd_stdin);
|
||||||
(void) close(fd_stdout);
|
(void) close(fd_stdout);
|
||||||
|
|
||||||
|
// After exec, all signal handlers are restored to their default values,
|
||||||
|
// with one exception of SIGCHLD. According to POSIX.1-2001 and Linux's
|
||||||
|
// implementation, SIGCHLD's handler will leave unchanged after exec
|
||||||
|
// if it was set to be ignored. Restore it to default action.
|
||||||
|
signal(SIGCHLD, SIG_DFL);
|
||||||
|
|
||||||
interp = conn->ctx->config[CGI_INTERPRETER];
|
interp = conn->ctx->config[CGI_INTERPRETER];
|
||||||
if (interp == NULL) {
|
if (interp == NULL) {
|
||||||
(void) execle(prog, prog, NULL, envp);
|
(void) execle(prog, prog, NULL, envp);
|
||||||
|
|||||||
Reference in new issue
Block a user