On Fri, Aug 29, 2014 at 11:25:52PM +0200, Alexander Bluhm wrote:
> I will try to pull parts of the diff into separate changes to
> make review easier.

The reapchild() signal handler collects all children.  This can be
done easier by ignoring SIGCHLD.

ok?

bluhm

Index: usr.sbin/syslogd/syslogd.c
===================================================================
RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.120
diff -u -p -r1.120 syslogd.c
--- usr.sbin/syslogd/syslogd.c  31 Aug 2014 20:51:31 -0000      1.120
+++ usr.sbin/syslogd/syslogd.c  31 Aug 2014 21:00:04 -0000
@@ -266,7 +266,6 @@ void        logmsg(int, char *, char *, int);
 struct filed *find_dup(struct filed *);
 void   printline(char *, char *);
 void   printsys(char *);
-void   reapchild(int);
 char   *ttymsg(struct iovec *, int, char *, int);
 void   usage(void);
 void   wallmsg(struct filed *, struct iovec *);
@@ -553,7 +552,7 @@ main(int argc, char *argv[])
        (void)signal(SIGTERM, dodie);
        (void)signal(SIGINT, Debug ? dodie : SIG_IGN);
        (void)signal(SIGQUIT, Debug ? dodie : SIG_IGN);
-       (void)signal(SIGCHLD, reapchild);
+       (void)signal(SIGCHLD, SIG_IGN);
        (void)signal(SIGALRM, domark);
        (void)signal(SIGPIPE, SIG_IGN);
        (void)alarm(TIMERINTVL);
@@ -1117,18 +1116,6 @@ wallmsg(struct filed *f, struct iovec *i
        }
        (void)fclose(uf);
        reenter = 0;
-}
-
-/* ARGSUSED */
-void
-reapchild(int signo)
-{
-       int save_errno = errno;
-       int status;
-
-       while (waitpid(-1, &status, WNOHANG) > 0)
-               ;
-       errno = save_errno;
 }
 
 /*

Reply via email to