diff options
author | Christopher Faylor <me@cgf.cx> | 2011-10-10 22:01:06 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-10-10 22:01:06 +0000 |
commit | be96a30c4370868ab29294ba09057e45bfb4bc2d (patch) | |
tree | 14456d684b1dc705335d43348a03d4251a877484 | |
parent | 4c34aaba558c4c46dc430b7e403d768da510d977 (diff) | |
download | cygnal-be96a30c4370868ab29294ba09057e45bfb4bc2d.tar.gz cygnal-be96a30c4370868ab29294ba09057e45bfb4bc2d.tar.bz2 cygnal-be96a30c4370868ab29294ba09057e45bfb4bc2d.zip |
* syscalls.cc (open): Add temporary kludge to avoid assigning the controlling
tty on open unless the open is for stdin/stdout/stderr.
* tty.cc (tty_list::connect): Set ENXIO when can't find a tty.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/tty.cc | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0abec830e..0d1e1878b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * syscalls.cc (open): Add temporary kludge to avoid assigning the + controlling tty on open unless the open is for stdin/stdout/stderr. + * tty.cc (tty_list::connect): Set ENXIO when can't find a tty. + 2011-10-10 Corinna Vinschen <corinna@vinschen.de> * fhandler.h (fhandler_process::closedir): Declare. diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 54d75d0e9..162825442 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1130,6 +1130,12 @@ open (const char *unix_path, int flags, ...) if (fd >= 0) { + /* This is a temporary kludge until all utilities can catch up with + a change in behavior that implements linux functionality: opening + a tty should not automatically cause it to become the controlling + tty for the process. */ + if (fd > 2) + flags |= O_NOCTTY; if (!(fh = build_fh_name (unix_path, (flags & (O_NOFOLLOW | O_EXCL)) ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW, diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index e751d30c2..30879b0e3 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -103,6 +103,7 @@ tty_list::connect (int ttynum) if (!ttys[ttynum].exists ()) { termios_printf ("tty %d was not allocated", ttynum); + set_errno (ENXIO); return -1; } |