lib/util: Make ECHILD in samba_runcmd_io_handler an error
authorAndrew Bartlett <abartlet@samba.org>
Wed, 18 Feb 2015 23:41:34 +0000 (12:41 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 17 Mar 2015 06:05:43 +0000 (07:05 +0100)
We now print out a nasty message and set and error if we get ECHILD,
as we no longer set SIGIGN on SIGCHLD in the standard process model.

This was why samba_kcc was able to fail totally without us noticing.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 17 07:05:43 CET 2015 on sn-devel-104

lib/util/util_runcmd.c

index 1ec717f548864433535f55f11c5ff4233c0425b8..46c455d3d0349084ca332d94ba9de6e54b1f79e4 100644 (file)
@@ -288,7 +288,11 @@ static void samba_runcmd_io_handler(struct tevent_context *ev,
                                           SIGCHLD in the standard
                                           process model.
                                        */
-                                       tevent_req_done(req);
+                                       DEBUG(0, ("Error in waitpid() unexpectedly got ECHILD "
+                                                 "for %s child %d - %s, "
+                                                 "someone has set SIGCHLD to SIG_IGN!\n",
+                                         state->arg0, state->pid, strerror(errno)));
+                                       tevent_req_error(req, errno);
                                        return;
                                }
                                DEBUG(0,("Error in waitpid() for child %s - %s \n",