aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-11-16 20:23:33 -0800
committerGuy Harris <guy@alum.mit.edu>2017-11-17 04:24:22 +0000
commitbbeb5acb07132335fa7ccf89166429359cf1be37 (patch)
tree279351d615a2f5647c2bd644d52a10b350083916 /dumpcap.c
parentd9f8ddd78049eea607e052c562813e95475e8c44 (diff)
Allow dumpcap to write to a named pipe.
We didn't actually bother *opening* the named pipe if it wasn't named "-" (meaning "use standard output"). Hilarity^WRandom failure behavior ensued. Change-Id: If73cea232b13de664630d587167167ef53a95cba Reviewed-on: https://code.wireshark.org/review/24454 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index cc420bae49..f73d60e92e 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2852,6 +2852,11 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
/* set output pipe to binary mode to avoid Windows text-mode processing (eg: for CR/LF) */
_setmode(1, O_BINARY);
#endif
+ } else {
+ /* Try to open the specified FIFO for use as a capture buffer.
+ Do *not* create it if it doesn't exist. There's nothing
+ to truncate. If we need to read it, We Have A Problem. */
+ *save_file_fd = ws_open(capfile_name, O_WRONLY|O_BINARY, 0);
}
} /* if (...output_to_pipe ... */