Error from waitpid(): Fix Code is unreachable
authorStephan Kappertz <octopus.sk@googlemail.com>
Wed, 18 Nov 2015 11:13:08 +0000 (12:13 +0100)
committerGuy Harris <guy@alum.mit.edu>
Wed, 18 Nov 2015 18:40:25 +0000 (18:40 +0000)
Change-Id: Ib93bd7d62eb16177cfdcb82148c97a64f6e497b4
Reviewed-on: https://code.wireshark.org/review/11939
Reviewed-by: Guy Harris <guy@alum.mit.edu>
capchild/capture_sync.c

index 81344be45098fc690fa7724d5a23bfc884d250ff..b1e1e38f2f9a9242cd046c4bc9e7787fafc9ac5c 100644 (file)
@@ -2012,12 +2012,12 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
                                         fork_child_status);
                 ret = -1;
             }
-        } else if (errno != ECHILD) {
-            *msgp = g_strdup_printf("Error from waitpid(): %s", g_strerror(errno));
-            ret = -1;
         } else if (errno == EINTR) {
             g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_WARNING, "sync_pipe_wait_for_child: waitpid returned EINTR. retrying.");
             continue;
+        } else if (errno != ECHILD) {
+            *msgp = g_strdup_printf("Error from waitpid(): %s", g_strerror(errno));
+            ret = -1;
         } else {
             /* errno == ECHILD ; echld might have already reaped the child */
             ret = fetch_dumpcap_pid ? 0 : -1;