diff options
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/file_access.c | 6 |
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; |