summaryrefslogtreecommitdiff
path: root/Modules/main.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-17 22:05:38 +0000
committerGuido van Rossum <guido@python.org>1997-01-17 22:05:38 +0000
commita1c5ab57dcc8b3a3f0631b8b51b68bc521657dc7 (patch)
treefd7cb30c1b0ac1c0a37c623009e5b0bd721c0966 /Modules/main.c
parenta5d11e41267d55135dbdddad61e069a6266b6799 (diff)
downloadcpython-a1c5ab57dcc8b3a3f0631b8b51b68bc521657dc7.tar.gz
Fix the _setmode() patch for MS_WINDOWS: include <fcntl.h> and use
fileno(std*).
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 15d0cc5cca..789f76456e 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -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);