aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-01-05 22:24:09 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-01-05 22:24:09 +0000
commit548d44c0413c05d67e209f6ab554610a62ee2535 (patch)
tree4633a9276beaae3a2b724579749a4fa2c72f85b4 /wiretap/file_access.c
parent368f7d87c7c1e3fc7926d3585769b0e6680a09bd (diff)
Win32: set stdout to binary mode in wtap_dump_fdopen(), so tethereal is also able to write capture files to stdout using -w -
svn path=/trunk/; revision=16958
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index 4cb8f2824a..90e4fe437e 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -655,6 +655,12 @@ wtap_dumper* wtap_dump_fdopen(int fd, int filetype, int encap, int snaplen,
if (wdh == NULL)
return NULL; /* couldn't allocate it */
+#ifdef _WIN32
+ if(fd == 1) {
+ setmode(fileno(stdout), O_BINARY);
+ }
+#endif
+
/* In case "fopen()" fails but doesn't set "errno", set "errno"
to a generic "the open failed" error. */
errno = WTAP_ERR_CANT_OPEN;