From: wmeier Date: Thu, 17 May 2007 01:41:47 +0000 (+0000) Subject: Minor fix: For "wireshark -Q ..." show "no packets captured" popup only when valid. X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=acb23072571f8259abe6b97575bbb75e71afc0ac Minor fix: For "wireshark -Q ..." show "no packets captured" popup only when valid. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21810 f5534014-38df-0310-8fa8-9805f1628bb7 --- diff --git a/capture.c b/capture.c index f412e6c866..b5f83001b5 100644 --- a/capture.c +++ b/capture.c @@ -455,7 +455,7 @@ void capture_input_closed(capture_options *capture_opts) { int err; - + int packet_count_save; g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture stopped!"); g_assert(capture_opts->state == CAPTURE_PREPARING || capture_opts->state == CAPTURE_RUNNING); @@ -471,11 +471,13 @@ capture_input_closed(capture_options *capture_opts) } if(capture_opts->real_time_mode) { - cf_read_status_t status; + cf_read_status_t status; /* Read what remains of the capture file. */ status = cf_finish_tail(capture_opts->cf, &err); + /* XXX: If -Q (quit-after-cap) then cf->count clr'd below so save it first */ + packet_count_save = cf_get_packet_count(capture_opts->cf); /* Tell the GUI, we are not doing a capture any more. Must be done after the cf_finish_tail(), so file lengths are displayed correct. */ @@ -485,7 +487,7 @@ capture_input_closed(capture_options *capture_opts) switch (status) { case CF_READ_OK: - if(cf_get_packet_count(capture_opts->cf) == 0 && !capture_opts->restart) { + if ((packet_count_save == 0) && !capture_opts->restart) { simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK, "%sNo packets captured!%s\n" "\n"