diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-01-05 22:24:09 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-01-05 22:24:09 +0000 |
commit | 548d44c0413c05d67e209f6ab554610a62ee2535 (patch) | |
tree | 4633a9276beaae3a2b724579749a4fa2c72f85b4 | |
parent | 368f7d87c7c1e3fc7926d3585769b0e6680a09bd (diff) | |
download | wireshark-548d44c0413c05d67e209f6ab554610a62ee2535.tar.gz wireshark-548d44c0413c05d67e209f6ab554610a62ee2535.tar.bz2 wireshark-548d44c0413c05d67e209f6ab554610a62ee2535.zip |
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
-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; |