Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/ntp/dist/libntp we set SIGCHLD to SIG_IGN so we...



details:   https://anonhg.NetBSD.org/src/rev/311b7c87153b
branches:  trunk
changeset: 339410:311b7c87153b
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 20 15:35:00 2015 +0000

description:
we set SIGCHLD to SIG_IGN so we are not going to generate zombies so it
will be an error to wait.

diffstat:

 external/bsd/ntp/dist/libntp/work_fork.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 4c5a8c7cff41 -r 311b7c87153b external/bsd/ntp/dist/libntp/work_fork.c
--- a/external/bsd/ntp/dist/libntp/work_fork.c  Mon Jul 20 14:37:11 2015 +0000
+++ b/external/bsd/ntp/dist/libntp/work_fork.c  Mon Jul 20 15:35:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: work_fork.c,v 1.6 2015/07/17 15:17:07 christos Exp $   */
+/*     $NetBSD: work_fork.c,v 1.7 2015/07/20 15:35:00 christos Exp $   */
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -127,7 +127,13 @@
                /* Wait on the child so it can finish terminating */
                if (waitpid(c->pid, NULL, 0) == c->pid)
                        TRACE(4, ("harvested child %d\n", c->pid));
-               else msyslog(LOG_ERR, "error waiting on child %d: %m", c->pid);
+               else if (errno != ECHILD) {
+                       /*
+                        * SIG_IGN on SIGCHLD on some os's means do not wait
+                        * but reap automaticallyi
+                        */
+                       msyslog(LOG_ERR, "error waiting on child %d: %m", c->pid);
+               }
                c->pid = 0;
        }
 }



Home | Main Index | Thread Index | Old Index