diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-09-23 07:57:23 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-09-23 07:57:23 +0000 |
commit | f0e861465cc9b5fac4b302e5e3bc4fe34cf9e4c4 (patch) | |
tree | d436fd6d25bcf2e7f2ec0aa321a745cff6b8d648 /gtk/main.c | |
parent | b2b8994f151b17971fbc57c2b70fb02eecefbfe1 (diff) | |
download | wireshark-f0e861465cc9b5fac4b302e5e3bc4fe34cf9e4c4.tar.gz wireshark-f0e861465cc9b5fac4b302e5e3bc4fe34cf9e4c4.tar.bz2 wireshark-f0e861465cc9b5fac4b302e5e3bc4fe34cf9e4c4.zip |
Close the capture file in "do_capture()", right before unlinking the
current capture file if it's a temporary file, out of paranoia (so that
we don't get into a state where we have a capture file open but unlinked
- it's probably harmless to be in that state, as the file will remain
around until close, modulo NFS fun, and we may never be in that state
for very long, but I'd rather have it obviously stated in the code).
Remove the close in "capture()", and put one before the other call to
"capture()", in "main_realize_cb()" (is that call necessary, e.g. if you
pass "-r <filename>" *and* "-k", for some perverse reason, as
command-line arguments?).
If "cf.save_file" is non-null, free it before setting it, regardless of
whether it refers to a temporary file name or not.
svn path=/trunk/; revision=712
Diffstat (limited to 'gtk/main.c')
-rw-r--r-- | gtk/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/main.c b/gtk/main.c index d3314be5be..70b6b20aad 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.8 1999/09/23 07:20:20 guy Exp $ + * $Id: main.c,v 1.9 1999/09/23 07:57:23 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -437,6 +437,10 @@ void main_realize_cb(GtkWidget *w, gpointer data) { #ifdef HAVE_LIBPCAP if (start_capture) { + /* XXX - "capture()" used to do this, but we now do it in + "do_capture()", before calling "capture()"; will we ever + have a capture file open here? */ + close_cap_file(&cf, info_bar, file_ctx); capture(); start_capture = 0; } |