aboutsummaryrefslogtreecommitdiffstats
path: root/reordercap.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:11:50 +0000
commit827b7dd75680b26e2bfddb0dac2f42f1dad69e7a (patch)
tree6e2f0010572a5073789163fd0abbf270f739e44a /reordercap.c
parent630ccbe2d74338bac6d8abe69705cf0401baa8c1 (diff)
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: I9f7e4d142b3bd598055d806b7ded1cb4c378de8e Reviewed-on: https://code.wireshark.org/review/11673 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'reordercap.c')
-rw-r--r--reordercap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/reordercap.c b/reordercap.c
index efbbfdaf36..fef413dd75 100644
--- a/reordercap.c
+++ b/reordercap.c
@@ -276,8 +276,8 @@ DIAG_ON(cast-qual)
/* Open outfile (same filetype/encap as input file) */
if (strcmp(outfile, "-") == 0) {
- pdh = wtap_dump_fdopen_ng(1, wtap_file_type_subtype(wth), wtap_file_encap(wth),
- 65535, FALSE, shb_hdr, idb_inf, nrb_hdr, &err);
+ pdh = wtap_dump_open_stdout_ng(wtap_file_type_subtype(wth), wtap_file_encap(wth),
+ 65535, FALSE, shb_hdr, idb_inf, nrb_hdr, &err);
outfile = "standard output";
} else {
pdh = wtap_dump_open_ng(outfile, wtap_file_type_subtype(wth), wtap_file_encap(wth),