aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2007-05-17 01:41:47 +0000
committerBill Meier <wmeier@newsguy.com>2007-05-17 01:41:47 +0000
commitc38d837c4a46855b2162b320495d0b4552692950 (patch)
treec4441f7ae274ccfcf4d2199aacae3e6b431100de /capture.c
parentc6addcd89fb49fdde7460275aa6ef5557d57c61e (diff)
Minor fix: For "wireshark -Q ..." show "no packets captured" popup only when valid.
svn path=/trunk/; revision=21810
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c8
1 files changed, 5 insertions, 3 deletions
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"