Exit with 1, not 2, if exec fails, so we don't report an additional
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 9 Jan 2008 11:50:22 +0000 (11:50 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 9 Jan 2008 11:50:22 +0000 (11:50 +0000)
error for the exit status, over and above the one for the exec failure.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24041 f5534014-38df-0310-8fa8-9805f1628bb7

capture_sync.c

index 92b3cb06a09957de3022fba4e0f77be5b15e3e13..fed74a4a2a6251220100818c2360dc132fefea65 100644 (file)
@@ -517,8 +517,11 @@ sync_pipe_start(capture_options *capture_opts) {
       /* Exit with "_exit()", so that we don't close the connection
          to the X server (and cause stuff buffered up by our parent but
         not yet sent to be sent, as that stuff should only be sent by
-        our parent). */
-      _exit(2);
+        our parent).  We've sent an error message to the parent, so
+        we exit with an exit status of 1 (any exit status other than
+        0 or 1 will cause an additional message to report that exit
+        status, over and above the error message we sent to the parent). */
+      _exit(1);
     }
 
     sync_pipe_read_fd = sync_pipe[PIPE_READ];
@@ -688,8 +691,11 @@ sync_pipe_open_command(const char** argv, int *read_fd, int *fork_child, gchar *
         /* Exit with "_exit()", so that we don't close the connection
            to the X server (and cause stuff buffered up by our parent but
            not yet sent to be sent, as that stuff should only be sent by
-           our parent). */
-        _exit(2);
+           our parent).  We've sent an error message to the parent, so
+           we exit with an exit status of 1 (any exit status other than
+           0 or 1 will cause an additional message to report that exit
+           status, over and above the error message we sent to the parent). */
+        _exit(1);
     }
 
     *read_fd = sync_pipe[PIPE_READ];