diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-12-03 14:19:26 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-12-03 14:19:26 +0000 |
commit | 3f222974e1fdb85d6e88cc09d143c5466f9ed95f (patch) | |
tree | 0457cfd4406f45a4f59330ecd95bdb832f93e550 /src | |
parent | a4a87b48a91ed42495416b5a1e06511677b6e7e5 (diff) | |
download | anubis-3f222974e1fdb85d6e88cc09d143c5466f9ed95f.tar.gz anubis-3f222974e1fdb85d6e88cc09d143c5466f9ed95f.tar.bz2 |
(loop): Block SIGCHLD while incrementing nchild
Diffstat (limited to 'src')
-rw-r--r-- | src/daemon.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/daemon.c b/src/daemon.c index fd2d02c..090723d 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -206,6 +206,7 @@ loop (int sd_bind) #ifdef USE_LIBWRAP struct request_info req; #endif /* USE_LIBWRAP */ + sigset_t blockset; addrlen = sizeof (addr); signal (SIGCHLD, sig_cld); @@ -257,7 +258,11 @@ loop (int sd_bind) process_rcfile (CF_SUPERVISOR); } + sigemptyset (&blockset); + sigaddset (&blockset, SIGCHLD); + sigprocmask (SIG_BLOCK, &blockset, NULL); nchild++; + sigprocmask (SIG_UNBLOCK, &blockset, NULL); if (nchild > MAXCLIENTS) { info (NORMAL, |