summaryrefslogtreecommitdiff
path: root/randpkt.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-11-10 02:01:43 -0800
committerGuy Harris <guy@alum.mit.edu>2015-11-10 10:19:05 +0000
commit019557eb88d13007fe44995137b586bc6fba0c8b (patch)
tree9340911a2041a936e0512ec5a53544040317e8c6 /randpkt.c
parent6b5837c222fd43fb6c43b6aa2510f4ca3ee78828 (diff)
downloadwireshark-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/randpkt.c b/randpkt.c
index 9d61d78f3f..603448ece7 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -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 {