diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2009-09-13 17:46:10 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2009-09-13 17:46:10 +0000 |
commit | af6fca176de13ce84b49ae7a5d80a8590600c8bc (patch) | |
tree | 4725ef01f64cdd997bce450fd0e393e09a62a21f /capture_sync.c | |
parent | b61ea82d55b680074aead09067f001e00667ed20 (diff) | |
download | wireshark-af6fca176de13ce84b49ae7a5d80a8590600c8bc.tar.gz wireshark-af6fca176de13ce84b49ae7a5d80a8590600c8bc.tar.bz2 wireshark-af6fca176de13ce84b49ae7a5d80a8590600c8bc.zip |
Don't use SIGUSR1 to tell dumpcap to exit, use SIGINT: SIGINT is traditionally
used for this purpose and using it also prevents the 2 signals the child gets:
- the user's Ctrl-C (which is sent as a SIGINT to both *shark and its
child dumpcap)
- the signal *shark generates to shut down the child
from colliding (and running 2 signal handlers in the child).
It might be possible for tshark to not send the signal at all when it gets
SIGINT, but it doesn't do any harm now.
Also, do not call g_log() within the signal handler: doing so can cause
aborts (if g_log is being called by the process when the signal comes, the
2nd entrance into g_log is detected as a recursion).
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2767
svn path=/trunk/; revision=29881
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/capture_sync.c b/capture_sync.c index 28f2b386c8..2d072fe88c 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -1425,11 +1425,11 @@ sync_pipe_stop(capture_options *capture_opts) if (capture_opts->fork_child != -1) { #ifndef _WIN32 - /* send the SIGUSR1 signal to close the capture child gracefully. */ - int sts = kill(capture_opts->fork_child, SIGUSR1); + /* send the SIGINT signal to close the capture child gracefully. */ + int sts = kill(capture_opts->fork_child, SIGINT); if (sts != 0) { g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_WARNING, - "Sending SIGUSR1 to child failed: %s\n", strerror(errno)); + "Sending SIGINT to child failed: %s\n", strerror(errno)); } #else #define STOP_SLEEP_TIME 500 /* ms */ |