17 |
|
|
18 |
#include "pop3d.h" |
#include "pop3d.h" |
19 |
|
|
20 |
RETSIGTYPE |
static int need_cleanup = 0; |
21 |
pop3d_sigchld (int signo ARG_UNUSED) |
|
22 |
|
void |
23 |
|
process_cleanup () |
24 |
{ |
{ |
25 |
pid_t pid; |
pid_t pid; |
26 |
int status; |
int status; |
27 |
|
|
28 |
|
if (need_cleanup) |
29 |
|
{ |
30 |
|
need_cleanup = 0; |
31 |
|
while ( (pid = waitpid (-1, &status, WNOHANG)) > 0) |
32 |
|
--children; |
33 |
|
} |
34 |
|
} |
35 |
|
|
36 |
while ( (pid = waitpid(-1, &status, WNOHANG)) > 0) |
RETSIGTYPE |
37 |
--children; |
pop3d_sigchld (int signo ARG_UNUSED) |
38 |
|
{ |
39 |
|
need_cleanup = 1; |
40 |
#ifndef HAVE_SIGACTION |
#ifndef HAVE_SIGACTION |
|
/* On some system, signal implements the unreliable semantic and |
|
|
has to be rearm. */ |
|
41 |
signal (signo, pop3d_sigchld); |
signal (signo, pop3d_sigchld); |
42 |
#endif |
#endif |
43 |
} |
} |