aboutsummaryrefslogtreecommitdiffstats
path: root/posix/gawkmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/gawkmisc.c')
-rw-r--r--posix/gawkmisc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index 5f9dec82..242d1e02 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -207,6 +207,9 @@ int
os_setbinmode(fd, mode)
int fd, mode;
{
+#ifdef __CYGWIN__
+ setmode (fd, mode);
+#endif
return 0;
}
@@ -221,11 +224,12 @@ int fd;
}
#ifdef __CYGWIN__
+#include <stdio.h>
#include <sys/cygwin.h>
extern int _fmode;
void
-cygwin_premain0 (int argc, char **argv, struct per_process *myself)
+cygwin_premain0 (int argc, char **argv, void *myself)
{
static struct __cygwin_perfile pf[] =
{
@@ -235,4 +239,10 @@ cygwin_premain0 (int argc, char **argv, struct per_process *myself)
};
cygwin_internal (CW_PERFILE, pf);
}
+
+void
+cygwin_premain2 (int argc, char **argv, void *myself)
+{
+ setmode (fileno (stdin), O_TEXT);
+}
#endif