aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2004-02-09 19:19:19 +0000
committerUlf Lamping <ulf.lamping@web.de>2004-02-09 19:19:19 +0000
commit1987113fa61125e36727d15adb85cf4342975d14 (patch)
treec27e571dda799b8f7b0e5282cbd9f95ca96b1ac7
parent1b9bef2743ea3c9f033d9d3171ceae16aa944cb3 (diff)
bugfix: close capture file again, if empty after capturing
(bug appears only, if "update list of packets ..." not used) svn path=/trunk/; revision=10017
-rw-r--r--capture.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/capture.c b/capture.c
index a8bc5b2ef0..7bd3a8d714 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.236 2004/02/03 20:48:50 guy Exp $
+ * $Id: capture.c,v 1.237 2004/02/09 19:19:19 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -701,6 +701,16 @@ do_capture(const char *save_file)
g_free(cfile.save_file);
}
cfile.save_file = NULL;
+
+ /* if we didn't captured even a single packet, close the file again */
+ if(cfile.count == 0) {
+ simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK,
+ "%sNo packets captured!%s\n\n"
+ "As no data was captured, closing the %scapture file!",
+ simple_dialog_primary_start(), simple_dialog_primary_end(),
+ (cfile.is_tempfile) ? "temporary " : "");
+ cf_close(&cfile);
+ }
}
return TRUE;
}