diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-01-08 09:32:15 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-01-08 09:32:15 +0000 |
commit | 12d566c0acad92a519b0bfef73a955a648f555fe (patch) | |
tree | 2b2117f07519ea791bd6a6fef23dcce9b3ac2270 /capture.h | |
parent | 86a251065d768c8e88a6f5c62dc0e53d93cabb8e (diff) |
Add a routine to kill a capture child if it exists, so that if we exit
(by deleting the main window or selecting File->Quit or typing ^Q) while
an "Update list of packets in real time" capture is in progress, we can
abort the capture.
Arrange that "fork_child" is -1 when there is no capture child, so said
routine knows when it can kill the child.
When we exit, kill off any capture child, using that routine, and, if
we're exiting due to a request to delete the main window and, if a read
is in progress (from an "Update list of packets in real time" capture),
don't delete the main window - just set the "Read aborted" flag, so that
the code doing the read will see that flag (it will be called because
the pipe to the capture child is closed due to the child exiting) will
see that and clean up and exit itself.
svn path=/trunk/; revision=4498
Diffstat (limited to 'capture.h')
-rw-r--r-- | capture.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* capture.h * Definitions for packet capture windows * - * $Id: capture.h,v 1.26 2001/04/13 14:59:28 jfoster Exp $ + * $Id: capture.h,v 1.27 2002/01/08 09:32:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -45,6 +45,9 @@ int capture(gboolean *stats_known, struct pcap_stat *stats); /* Stop a capture from a menu item. */ void capture_stop(void); +/* Terminate the capture child cleanly when exiting. */ +void kill_capture_child(void); + #endif /* HAVE_LIBPCAP */ #define EMPTY_FILTER "" |