From 4248960e2f39e9913dc71da085883ee76a30b1e9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 7 Feb 2008 18:59:40 +0000 Subject: * dtable.cc (dtable::init_std_file_from_handle): Set access to read/write of handle is connected to a tty or console. * fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly after duplicating from archetype. * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto. (fhandler_pty_master::dup): Ditto. --- winsup/cygwin/dtable.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/dtable.cc') diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 6fcf7086e..62606693c 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 -- cgit v1.2.3