Commit a1c5ab57 authored by Guido van Rossum's avatar Guido van Rossum

Fix the _setmode() patch for MS_WINDOWS: include <fcntl.h> and use

fileno(std*).
parent a5d11e41
......@@ -37,6 +37,10 @@ PERFORMANCE OF THIS SOFTWARE.
#include <unistd.h>
#endif
#ifdef MS_WINDOWS
#include <fcntl.h>
#endif
/* Interface to getopt(): */
extern int optind;
extern char *optarg;
......@@ -163,8 +167,8 @@ main(argc, argv)
if (unbuffered) {
#ifdef MS_WINDOWS
_setmode(stdin, O_BINARY);
_setmode(stdout, O_BINARY);
_setmode(fileno(stdin), O_BINARY);
_setmode(fileno(stdout), O_BINARY);
#endif
#ifndef MPW
setbuf(stdout, (char *)NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment