summaryrefslogtreecommitdiff
path: root/winsup/cygwin/dtable.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 08180eb448e..17c333c0cc4 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -336,7 +336,9 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
}
DWORD access;
- if (fd == 0)
+ if (dev == FH_TTY || dev == FH_CONSOLE)
+ access = GENERIC_READ | GENERIC_WRITE;
+ else if (fd == 0)
access = GENERIC_READ;
else
access = GENERIC_WRITE; /* Should be rdwr for stderr but not sure that's