/[mailutils]/mailutils/pop3d/signal.c
ViewVC logotype

Diff of /mailutils/pop3d/signal.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by gray, Sun Mar 23 22:57:56 2003 UTC revision 1.18 by gray, Thu Sep 18 10:06:36 2003 UTC
# Line 17  Line 17 
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  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26