aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2010-05-27 23:46:01 +0000
committerBill Meier <wmeier@newsguy.com>2010-05-27 23:46:01 +0000
commitece0ada557432588b8dbe66c2c877e61fef9a78e (patch)
treef3173e2d5bc0a0b4b97a0dab8ebb141ae33cb472 /tshark.c
parentde3efcf4f56d1deb94cf15ee334df625cf646bf9 (diff)
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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tshark.c b/tshark.c
index 9dca76e4b8..3929b0ec0b 100644
--- a/tshark.c
+++ b/tshark.c
@@ -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;