diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-05-26 19:06:01 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-05-26 19:06:01 +0000 |
commit | 6a853e1bc32bc1ab1c852b7b347dbcbc8b206502 (patch) | |
tree | cf950cb9ec5ac3fc57bf6fb655e591654a8fc2fd /capture_sync.c | |
parent | edf3ec1d92ae0f869774e6d97a02217bd7e4cd12 (diff) | |
download | wireshark-6a853e1bc32bc1ab1c852b7b347dbcbc8b206502.tar.gz wireshark-6a853e1bc32bc1ab1c852b7b347dbcbc8b206502.tar.bz2 wireshark-6a853e1bc32bc1ab1c852b7b347dbcbc8b206502.zip |
some cleanup of capture error notification handling
svn path=/trunk/; revision=14441
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/capture_sync.c b/capture_sync.c index 249384de08..ebc38b216d 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -109,7 +109,7 @@ static char *sync_pipe_signame(int); static gboolean sync_pipe_input_cb(gint source, gpointer user_data); -static void sync_pipe_wait_for_child(capture_options *capture_opts, gboolean always_report); +static void sync_pipe_wait_for_child(capture_options *capture_opts); /* Size of buffer to hold decimal representation of signed/unsigned 64-bit int */ @@ -610,7 +610,7 @@ sync_pipe_input_cb(gint source, gpointer user_data) /* The child has closed the sync pipe, meaning it's not going to be capturing any more packets. Pick up its exit status, and complain if it did anything other than exit with status 0. */ - sync_pipe_wait_for_child(capture_opts, FALSE); + sync_pipe_wait_for_child(capture_opts); #ifdef _WIN32 close(capture_opts->signal_pipe_fd); @@ -663,7 +663,7 @@ sync_pipe_input_cb(gint source, gpointer user_data) /* the child process is going down, wait until it's completely terminated */ static void -sync_pipe_wait_for_child(capture_options *capture_opts, gboolean always_report) +sync_pipe_wait_for_child(capture_options *capture_opts) { int wstatus; @@ -682,9 +682,13 @@ sync_pipe_wait_for_child(capture_options *capture_opts, gboolean always_report) #else if (wait(&wstatus) != -1) { if (WIFEXITED(wstatus)) { - /* The child exited; display its exit status, if it's not zero, - and even if it's zero if "always_report" is true. */ - if (always_report || WEXITSTATUS(wstatus) != 0) { + /* The child exited; display its exit status, if it seems uncommon (0=ok, 1=error) */ + /* the child will inform us about errors through the sync_pipe, which will popup */ + /* an error message, so don't popup another one */ + + /* XXX - if there are situations where the child won't send us such an error message, */ + /* this should be fixed in the child and not here! */ + if (WEXITSTATUS(wstatus) != 0 && WEXITSTATUS(wstatus) != 1) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Child capture process exited: exit status %d", WEXITSTATUS(wstatus)); |