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
This commit is contained in:
Ulf Lamping 2006-01-05 22:24:09 +00:00
parent 368f7d87c7
commit 548d44c041
1 changed files with 6 additions and 0 deletions

View File

@ -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;