aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-10-11 12:39:31 +0000
committerChristopher Faylor <me@cgf.cx>2011-10-11 12:39:31 +0000
commit1e5bcae135c44a5468138db0a53419a0d7d69d10 (patch)
treeac1dcfe90647138f206ad12943076596a9509cb3 /winsup/cygwin
parentf13f2da4ee2eb36a740caddbfb09bbfd927bc52f (diff)
downloadnewlib-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')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dtable.cc12
2 files changed, 13 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0d1e187..5ae6083 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-11 Christopher Faylor <me.cygwin2011@cgf.cx>
+
+ * 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.
+
2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx>
* syscalls.cc (open): Add temporary kludge to avoid assigning the
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: