Author: trociny
Date: Mon Jun  4 09:22:22 2012
New Revision: 236550
URL: http://svn.freebsd.org/changeset/base/236550

Log:
  On a child exit, call waitpid(2) to clean up the process table.
  
  Submitted by: Andrey Zonov <andrey zonov.org>
  MFC after:    1 week

Modified:
  head/usr.sbin/daemon/daemon.c

Modified: head/usr.sbin/daemon/daemon.c
==============================================================================
--- head/usr.sbin/daemon/daemon.c       Mon Jun  4 08:40:14 2012        
(r236549)
+++ head/usr.sbin/daemon/daemon.c       Mon Jun  4 09:22:22 2012        
(r236550)
@@ -217,6 +217,10 @@ wait_child(pid_t pid, sigset_t *mask)
                }
                switch (signo) {
                case SIGCHLD:
+                       if (waitpid(pid, NULL, WNOHANG) == -1) {
+                               warn("waitpid");
+                               return (-1);
+                       }
                        return (terminate);
                case SIGTERM:
                        terminate = 1;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to