diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-09 19:19:19 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-09 19:19:19 +0000 |
commit | 40aaa5d5a96b5366d4b1e90fa9c7a726d3860f7b (patch) | |
tree | c27e571dda799b8f7b0e5282cbd9f95ca96b1ac7 /capture.c | |
parent | ebdc59943507a38a4d5dbf66393dc7fb343a5ec3 (diff) |
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
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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; } |