summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
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 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);