X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=contrib%2Fpackage%2Fuhttpd%2Fsrc%2Fuhttpd-cgi.c;fp=contrib%2Fpackage%2Fuhttpd%2Fsrc%2Fuhttpd-cgi.c;h=5565197ca7e576a2b1bf6b2069fa19a95172d494;hp=a239c8bc992ae30a0930defdfd93f89c7d20da16;hb=d817ebf0070cd6c70b49fb3c4e13becb0544e429;hpb=fa712a0bc9ac90b2172877dc9835c38945838b39 diff --git a/contrib/package/uhttpd/src/uhttpd-cgi.c b/contrib/package/uhttpd/src/uhttpd-cgi.c index a239c8bc9..5565197ca 100644 --- a/contrib/package/uhttpd/src/uhttpd-cgi.c +++ b/contrib/package/uhttpd/src/uhttpd-cgi.c @@ -155,6 +155,7 @@ void uh_cgi_request(struct client *cl, struct http_request *req, struct path_inf fd_set reader; fd_set writer; + struct sigaction sa; struct timeval timeout; struct http_response *res; @@ -184,7 +185,13 @@ void uh_cgi_request(struct client *cl, struct http_request *req, struct path_inf /* exec child */ case 0: - /* child */ + /* restore SIGTERM */ + sa.sa_flags = 0; + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sigaction(SIGTERM, &sa, NULL); + + /* close loose pipe ends */ close(rfd[0]); close(wfd[1]);