From 19feec86dfd4b61383b67afdd4c5f361e3c1e003 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 13 Feb 2000 10:36:06 +0000 Subject: [PATCH] When exiting Ethereal, don't just unlink any temporary capture file, call "close_cap_file()", which will unlink the current capture file if it's a temporary file - but will do so after closing it; certain OSes whose names begin with "W" don't let you remove a file if it's currently open, so if you exit Ethereal, without closing the capture first, after doing a capture on one of those OSes, the temporary file won't be removed. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1628 f5534014-38df-0310-8fa8-9805f1628bb7 --- gtk/main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gtk/main.c b/gtk/main.c index 3d05e3bf4b..f697c8039c 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.104 2000/02/12 06:46:53 guy Exp $ + * $Id: main.c,v 1.105 2000/02/13 10:36:06 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -960,12 +960,14 @@ set_ptree_expander_style(gint style) void -file_quit_cmd_cb (GtkWidget *widget, gpointer data) { - /* If we have a capture file open, and it's a temporary file, - unlink it. */ - if (cf.filename != NULL && cf.is_tempfile) - unlink(cf.filename); - gtk_exit(0); +file_quit_cmd_cb (GtkWidget *widget, gpointer data) +{ + /* Close any capture file we have open; on some OSes, you can't + unlink a temporary capture file if you have it open. + "close_cap_file()" will unlink it after closing it if + it's a temporary file. */ + close_cap_file(&cf, info_bar); + gtk_exit(0); } /* call initialization routines at program startup time */ -- 2.34.1