projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uhttpd: properly initialize sigaction, restore SIGTERM for childs
[project/luci.git]
/
contrib
/
package
/
uhttpd
/
src
/
uhttpd-cgi.c
diff --git
a/contrib/package/uhttpd/src/uhttpd-cgi.c
b/contrib/package/uhttpd/src/uhttpd-cgi.c
index
a239c8b
..
5565197
100644
(file)
--- 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;
fd_set reader;
fd_set writer;
+ struct sigaction sa;
struct timeval timeout;
struct http_response *res;
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:
/* 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]);
close(rfd[0]);
close(wfd[1]);