]> granicus.if.org Git - python/commitdiff
Fix the _setmode() patch for MS_WINDOWS: include <fcntl.h> and use
authorGuido van Rossum <guido@python.org>
Fri, 17 Jan 1997 22:05:38 +0000 (22:05 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 17 Jan 1997 22:05:38 +0000 (22:05 +0000)
fileno(std*).

Modules/main.c

index 15d0cc5ccaf014820d7c559815d1fe3dcaa1a219..789f76456e931491dbb2af0eb756d50d777438ec 100644 (file)
@@ -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);