dont log an error if waitpid returns -1 and errno is ECHILD
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 19 Jun 2009 05:55:13 +0000 (15:55 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 19 Jun 2009 05:55:13 +0000 (15:55 +1000)
server/ctdb_recoverd.c

index 07f3f0da13cca4ab633eb58643dc108f2c12fa2b..3ab44a739548ceb1a60c325a99cb83ec69a32ae5 100644 (file)
@@ -3094,7 +3094,9 @@ static void recd_sig_child_handler(struct event_context *ev,
        while (pid != 0) {
                pid = waitpid(-1, &status, WNOHANG);
                if (pid == -1) {
-                       DEBUG(DEBUG_ERR, (__location__ " waitpid() returned error. errno:%d\n", errno));
+                       if (errno != ECHILD) {
+                               DEBUG(DEBUG_ERR, (__location__ " waitpid() returned error. errno:%s(%d)\n", strerror(errno),errno));
+                       }
                        return;
                }
                if (pid > 0) {