diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-02-07 18:59:40 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-02-07 18:59:40 +0000 |
commit | 4248960e2f39e9913dc71da085883ee76a30b1e9 (patch) | |
tree | 893cdbe10af13e4d56101e1206de81a7e8c6a021 | |
parent | 62688407cbb3e8db6cf683046989deac42e3058e (diff) | |
download | newlib-4248960e2f39e9913dc71da085883ee76a30b1e9.zip newlib-4248960e2f39e9913dc71da085883ee76a30b1e9.tar.gz newlib-4248960e2f39e9913dc71da085883ee76a30b1e9.tar.bz2 |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/dtable.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_dsp.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 2 |
4 files changed, 15 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 52d4212..6078d7d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2008-02-07 Corinna Vinschen <corinna@vinschen.de> + + * 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. + 2008-02-06 Corinna Vinschen <corinna@vinschen.de> * miscfuncs.cc (next_char): Fix typos in comment. diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 6fcf708..6260669 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 diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index 8ef89bf..249fa77 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -1131,6 +1131,7 @@ fhandler_dev_dsp::dup (fhandler_base * child) { debug_printf (""); child->archetype = archetype; + child->set_flags (get_flags ()); archetype->usecount++; return 0; } diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 75dd8a0..44a811a 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -928,6 +928,7 @@ fhandler_tty_slave::dup (fhandler_base *child) { fhandler_tty_slave *arch = (fhandler_tty_slave *) archetype; *(fhandler_tty_slave *) child = *arch; + child->set_flags (get_flags ()); child->usecount = 0; arch->usecount++; cygheap->manage_console_count ("fhandler_tty_slave::dup", 1); @@ -940,6 +941,7 @@ fhandler_pty_master::dup (fhandler_base *child) { fhandler_tty_master *arch = (fhandler_tty_master *) archetype; *(fhandler_tty_master *) child = *arch; + child->set_flags (get_flags ()); child->usecount = 0; arch->usecount++; report_tty_counts (child, "duped master", ""); |