diff options
author | Guy Harris <guy@alum.mit.edu> | 2007-10-10 01:31:36 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2007-10-10 01:31:36 +0000 |
commit | e8ea45d6ed037ba54a184d9737556900acdb248f (patch) | |
tree | 104d9fa95c2fd8bca4199a62e13e601fda3b82c0 /capture_sync.c | |
parent | d17e4e3ad9439aa7e0c14526a45ed6c2132dd1ee (diff) | |
download | wireshark-e8ea45d6ed037ba54a184d9737556900acdb248f.tar.gz |
Make the sync pipe the standard error, not the standard output, of
dumpcap, when using it as a capture child; leave the standard output
alone, in case tshark was told to write the capture to the standard
error.
Get rid of the argument to the "-Z" option to dumpcap; it might not work
on Windows.
svn path=/trunk/; revision=23124
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/capture_sync.c b/capture_sync.c index a31f019497..04d3244101 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -354,7 +354,6 @@ sync_pipe_start(capture_options *capture_opts) { /* dumpcap should be running in capture child mode (hidden feature) */ #ifndef DEBUG_CHILD argv = sync_pipe_add_arg(argv, &argc, "-Z"); - argv = sync_pipe_add_arg(argv, &argc, "1"); #endif #ifdef _WIN32 @@ -412,7 +411,7 @@ sync_pipe_start(capture_options *capture_opts) { si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; /* this hides the console window */ si.hStdInput = signal_pipe_read; - si.hStdOutput = sync_pipe_write; + si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); si.hStdError = sync_pipe_write; /*si.hStdError = (HANDLE) _get_osfhandle(2);*/ #endif @@ -466,7 +465,7 @@ sync_pipe_start(capture_options *capture_opts) { * Child process - run dumpcap with the right arguments to make * it just capture with the specified capture parameters */ - eth_close(1); + eth_close(2); dup(sync_pipe[PIPE_WRITE]); eth_close(sync_pipe[PIPE_READ]); execv(argv[0], (gpointer)argv); @@ -805,7 +804,6 @@ sync_interface_list_open(gchar **msg) { /* dumpcap should be running in capture child mode (hidden feature) */ #ifndef DEBUG_CHILD argv = sync_pipe_add_arg(argv, &argc, "-Z"); - argv = sync_pipe_add_arg(argv, &argc, "1"); #endif return sync_pipe_run_command(argv, msg); @@ -845,7 +843,6 @@ sync_linktype_list_open(gchar *ifname, gchar **msg) { /* dumpcap should be running in capture child mode (hidden feature) */ #ifndef DEBUG_CHILD argv = sync_pipe_add_arg(argv, &argc, "-Z"); - argv = sync_pipe_add_arg(argv, &argc, "1"); #endif return sync_pipe_run_command(argv, msg); @@ -883,7 +880,6 @@ sync_interface_stats_open(int *read_fd, int *fork_child, gchar **msg) { /* dumpcap should be running in capture child mode (hidden feature) */ #ifndef DEBUG_CHILD argv = sync_pipe_add_arg(argv, &argc, "-Z"); - argv = sync_pipe_add_arg(argv, &argc, "1"); #endif return sync_pipe_open_command(argv, read_fd, fork_child, msg); |