summaryrefslogtreecommitdiff
path: root/capture_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'capture_loop.c')
-rw-r--r--capture_loop.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/capture_loop.c b/capture_loop.c
index 057596b72b..a78efc20fc 100644
--- a/capture_loop.c
+++ b/capture_loop.c
@@ -1228,6 +1228,23 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
capture_info_update(&capture_ui);
}
+#if _WIN32
+ /* some news from our parent (signal pipe)? -> just stop the capture */
+ {
+ HANDLE handle;
+ DWORD avail = 0;
+ gboolean result;
+
+
+ handle = (HANDLE) _get_osfhandle (0);
+ result = PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL);
+
+ if(!result || avail > 0) {
+ ld.go = FALSE;
+ }
+ }
+#endif
+
/* Let the parent process know. */
if (ld.packets_sync_pipe) {
/* do sync here */