mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
[package] uhttpd: block SIGCHLD until it is expected (#6957)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20513 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -410,6 +410,9 @@ int main (int argc, char **argv)
|
||||
struct sigaction sa;
|
||||
struct config conf;
|
||||
|
||||
/* signal mask */
|
||||
sigset_t ss;
|
||||
|
||||
/* maximum file descriptor number */
|
||||
int new_fd, cur_fd, max_fd = 0;
|
||||
|
||||
@@ -432,7 +435,7 @@ int main (int argc, char **argv)
|
||||
FD_ZERO(&serv_fds);
|
||||
FD_ZERO(&read_fds);
|
||||
|
||||
/* handle SIGPIPE, SIGCHILD */
|
||||
/* handle SIGPIPE, SIGINT, SIGTERM, SIGCHLD */
|
||||
sa.sa_flags = 0;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
@@ -446,6 +449,11 @@ int main (int argc, char **argv)
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
|
||||
/* defer SIGCHLD */
|
||||
sigemptyset(&ss);
|
||||
sigaddset(&ss, SIGCHLD);
|
||||
sigprocmask(SIG_BLOCK, &ss, NULL);
|
||||
|
||||
/* prepare addrinfo hints */
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
||||
Reference in New Issue
Block a user