diff options
author | Christopher Faylor <me@cgf.cx> | 2011-10-11 12:39:31 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-10-11 12:39:31 +0000 |
commit | 1e5bcae135c44a5468138db0a53419a0d7d69d10 (patch) | |
tree | ac1dcfe90647138f206ad12943076596a9509cb3 /winsup/cygwin/dtable.cc | |
parent | f13f2da4ee2eb36a740caddbfb09bbfd927bc52f (diff) | |
download | newlib-1e5bcae135c44a5468138db0a53419a0d7d69d10.zip newlib-1e5bcae135c44a5468138db0a53419a0d7d69d10.tar.gz newlib-1e5bcae135c44a5468138db0a53419a0d7d69d10.tar.bz2 |
* dtable.cc (fh_alloc): Don't parse /dev/tty if ctty is < 0. Reset major/minor
from the specific tty to those for /dev/tty.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r-- | winsup/cygwin/dtable.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index d780136..a53596f 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -541,10 +541,14 @@ fh_alloc (device dev) break; case FH_TTY: { - if (iscons_dev (myself->ctty)) - fh = cnew (fhandler_console, dev); - else - fh = cnew (fhandler_pty_slave, myself->ctty); + if (myself->ctty > 0) + { + if (iscons_dev (myself->ctty)) + fh = cnew (fhandler_console, dev); + else + fh = cnew (fhandler_pty_slave, myself->ctty); + fh->dev () = FH_TTY; + } break; } case FH_KMSG: |