diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-02-09 19:19:19 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-02-09 19:19:19 +0000 |
commit | 1987113fa61125e36727d15adb85cf4342975d14 (patch) | |
tree | c27e571dda799b8f7b0e5282cbd9f95ca96b1ac7 /capture.c | |
parent | 1b9bef2743ea3c9f033d9d3171ceae16aa944cb3 (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
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; } |