From 40aaa5d5a96b5366d4b1e90fa9c7a726d3860f7b Mon Sep 17 00:00:00 2001 From: ulfl Date: Mon, 9 Feb 2004 19:19:19 +0000 Subject: bugfix: close capture file again, if empty after capturing (bug appears only, if "update list of packets ..." not used) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10017 f5534014-38df-0310-8fa8-9805f1628bb7 --- capture.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'capture.c') 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 @@ -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; } -- cgit v1.2.3