summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-17 22:05:38 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-17 22:05:38 (GMT)
commit3e7ae7ab173effc320b05a3d5a9fde7eac706771 (patch)
tree877c5f1482c0e1892b35d4fa5ccedf5f37d7b6f7 /Modules
parente3258019c8f0922934ea99a259ec1c742e5442ac (diff)
downloadcpython-3e7ae7ab173effc320b05a3d5a9fde7eac706771.zip
cpython-3e7ae7ab173effc320b05a3d5a9fde7eac706771.tar.gz
cpython-3e7ae7ab173effc320b05a3d5a9fde7eac706771.tar.bz2
Fix the _setmode() patch for MS_WINDOWS: include <fcntl.h> and use
fileno(std*).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 15d0cc5..789f764 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);