fd_set reader;
fd_set writer;
+ struct sigaction sa;
struct timeval timeout;
struct http_response *res;
/* 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]);
fd_set reader;
fd_set writer;
+ struct sigaction sa;
struct timeval timeout;
break;
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]);
FD_ZERO(&read_fds);
/* handle SIGPIPE, SIGCHILD */
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, NULL);
sigaction(SIGCHLD, &sa, NULL);