diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-07-01 00:12:16 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-07-01 00:12:16 +0000 |
commit | b0b7697dea7da93a261d6eeb8bf7562a4884bc5a (patch) | |
tree | 49de4177e15fd73502e2d2b372524999676dddb3 | |
parent | 6aaa5874c610def77b749831f785be309acaf853 (diff) | |
download | wireshark-b0b7697dea7da93a261d6eeb8bf7562a4884bc5a.tar.gz wireshark-b0b7697dea7da93a261d6eeb8bf7562a4884bc5a.tar.bz2 wireshark-b0b7697dea7da93a261d6eeb8bf7562a4884bc5a.zip |
From Petr Lautrbach: when capturing, return the exit status of dumpcap,
so we give a non-zero exit status for invalid interfaces or capture
filters.
From me: don't exit immediately if dumpcap failed, print out information
from taps and the like.
svn path=/trunk/; revision=33393
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | capture_opts.h | 1 | ||||
-rw-r--r-- | capture_sync.c | 3 | ||||
-rw-r--r-- | tshark.c | 2 |
4 files changed, 7 insertions, 0 deletions
@@ -3275,6 +3275,7 @@ Robert Bullen <robert [AT] bitcricket.com> Chuck Kristofek <chuck.kristofek [AT] ngc.com> Markus Renz <Markus.Renz [AT] hirschmann.de> Toshihiro Kataoka <kataoka.toshihiro [AT] gmail.com> +Petr Lautrbach <plautrba [AT] redhat.com> Dan Lasley <dlasley[AT]promus.com> gave permission for his dumpit() hex-dump routine to be used. diff --git a/capture_opts.h b/capture_opts.h index 34709fce04..ed287df9a1 100644 --- a/capture_opts.h +++ b/capture_opts.h @@ -151,6 +151,7 @@ typedef struct capture_options_tag { /* internally used (don't touch from outside) */ int fork_child; /**< If not -1, in parent, process ID of child */ + int fork_child_status; /**< Child exit status */ #ifdef _WIN32 int signal_pipe_write_fd; /**< the pipe to signal the child */ #endif diff --git a/capture_sync.c b/capture_sync.c index 4f2c49d673..585deebd71 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -593,6 +593,8 @@ sync_pipe_start(capture_options *capture_opts) { return FALSE; } + capture_opts->fork_child_status = 0; + /* we might wait for a moment till child is ready, so update screen now */ main_window_update(); @@ -1511,6 +1513,7 @@ sync_pipe_input_cb(gint source, gpointer user_data) /* No more child process. */ capture_opts->fork_child = -1; + capture_opts->fork_child_status = ret; #ifdef _WIN32 ws_close(capture_opts->signal_pipe_write_fd); @@ -1748,8 +1748,10 @@ main(int argc, char *argv[]) * * The capture code is a bit twisty, so it doesn't appear to * be an easy fix. We just ignore the return value for now. + * Instead, pass on the exit status from the capture child. */ capture(); + exit_status = global_capture_opts.fork_child_status; if (print_packet_info) { if (!write_finale()) { |