diff options
author | Bill Meier <wmeier@newsguy.com> | 2010-05-27 23:46:01 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2010-05-27 23:46:01 +0000 |
commit | ece0ada557432588b8dbe66c2c877e61fef9a78e (patch) | |
tree | f3173e2d5bc0a0b4b97a0dab8ebb141ae33cb472 /tshark.c | |
parent | de3efcf4f56d1deb94cf15ee334df625cf646bf9 (diff) | |
download | wireshark-ece0ada557432588b8dbe66c2c877e61fef9a78e.tar.gz wireshark-ece0ada557432588b8dbe66c2c877e61fef9a78e.tar.bz2 wireshark-ece0ada557432588b8dbe66c2c877e61fef9a78e.zip |
Fix bug #4735: tshark returns 0 on non-valid filter and interface.
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4735
svn path=/trunk/; revision=33004
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -158,7 +158,7 @@ static gboolean infodelay; /* if TRUE, don't print capture info in SIGINFO handl static gboolean infoprint; /* if TRUE, print capture info after clearing infodelay */ #endif /* SIGINFO */ -static int capture(void); +static gboolean capture(void); static void report_counts(void); #ifdef _WIN32 static BOOL WINAPI capture_cleanup(DWORD); @@ -1683,7 +1683,9 @@ main(int argc, char *argv[]) /* For now, assume libpcap gives microsecond precision. */ timestamp_set_precision(TS_PREC_AUTO_USEC); - capture(); + if (!capture()) { + return 1; /* an error occurred */ + } if (print_packet_info) { if (!write_finale()) { @@ -1828,7 +1830,7 @@ pipe_input_set_handler(gint source, gpointer user_data, int *child_process, pipe #ifdef HAVE_LIBPCAP -static int +static gboolean capture(void) { gboolean ret; |