diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-12-17 00:19:47 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-12-17 00:19:47 +0000 |
commit | 38d9c7ac482d487bab7a66089e7dfaf39b4b1a28 (patch) | |
tree | 3f959ca782ee6a11d1e2328c0f900312b454a2a6 /capture_loop.c | |
parent | 4a33af17d166b1bb4a9cfec3834a50f2d0738900 (diff) |
Win32 bugfix: peeking the signal_pipe at capture_loop start seems to be unreliable
Instead, simply keep the signal_pipe setting directly from the command line which is working well
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16833 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_loop.c')
-rw-r--r-- | capture_loop.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/capture_loop.c b/capture_loop.c index 4955b136ea..2f79687c14 100644 --- a/capture_loop.c +++ b/capture_loop.c @@ -1128,9 +1128,6 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct gboolean close_ok; char errmsg[4096+1]; int save_file_fd; -#ifdef _WIN32 - gboolean signal_pipe_enabled; -#endif /* init the loop data */ @@ -1157,11 +1154,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct /* We haven't yet gotten the capture statistics. */ *stats_known = FALSE; -#ifdef _WIN32 - /* get the initial state of the signal pipe */ - /* (if it's already stopped here, ignore it later) */ - signal_pipe_enabled = !signal_pipe_stopped(); -#else +#ifndef _WIN32 /* * Catch SIGUSR1, so that we exit cleanly if the parent process * kills us with it due to the user selecting "Capture->Stop". @@ -1241,8 +1234,10 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct inpkts = capture_loop_dispatch(capture_opts, &ld, errmsg, sizeof(errmsg)); #ifdef _WIN32 - /* some news from our parent (signal pipe)? -> just stop the capture */ - if (signal_pipe_stopped() && signal_pipe_enabled) { + fprintf(stderr, "fd: %u ret: %u\n", capture_opts->signal_pipe_fd, signal_pipe_stopped()); + + /* any news from our parent (signal pipe)? -> just stop the capture */ + if (capture_opts->signal_pipe_fd != -1 && signal_pipe_stopped()) { ld.go = FALSE; } #endif |