diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-11-10 02:01:43 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-11-10 10:19:05 +0000 |
commit | 019557eb88d13007fe44995137b586bc6fba0c8b (patch) | |
tree | 9340911a2041a936e0512ec5a53544040317e8c6 /randpkt.c | |
parent | 6b5837c222fd43fb6c43b6aa2510f4ca3ee78828 (diff) | |
download | wireshark-019557eb88d13007fe44995137b586bc6fba0c8b.tar.gz |
Skip only the actual file descriptor close when writing to stdout.
Have a "this is stdout" flag for a wtap_dumper, and have "open the
standard output for dumping" routines that set that flag. When closing
a wtap_dumper, do most of the work regardless of whether we're writing
to the standard output or not (so that everything gets written out) and
only skip the closing of the underlying file descriptor.
Change-Id: I80176dad0d9b5dff1b64c7d4703e0ab36501f547
Reviewed-on: https://code.wireshark.org/review/11674
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'randpkt.c')
-rw-r--r-- | randpkt.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -567,7 +567,7 @@ DIAG_ON(cast-qual) if (strcmp(produce_filename, "-") == 0) { /* Write to the standard output. */ - dump = wtap_dump_fdopen(1, WTAP_FILE_TYPE_SUBTYPE_PCAP, + dump = wtap_dump_open_stdout(WTAP_FILE_TYPE_SUBTYPE_PCAP, example->sample_wtap_encap, produce_max_bytes, FALSE /* compressed */, &err); filename = "the standard output"; } else { |