On Windows, open() in text mode followed by fdopen() in binary mode does not create a stream in binary mode. So add O_BINARY to open(). SVN revision: 61418