From 93b18fd23229c9d8e50ad778f8069af9a3425e90 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 10 Feb 2012 16:33:53 +0000 Subject: [PATCH] * syscalls.cc (open): Semi-revert (?) to allowing open of a tty to become controlling tty if there is no controlling tty. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/syscalls.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 67771d225..55a38b0fa 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2012-02-10 Christopher Faylor + + * syscalls.cc (open): Semi-revert (?) to allowing open of a tty to + become controlling tty if there is no controlling tty. + 2012-02-09 Christopher Faylor * exceptions.cc (setup_handler): Reduce system_printf to sigproc_printf diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index e392220c3..27063ec23 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1275,7 +1275,7 @@ open (const char *unix_path, int flags, ...) tty for the process. */ int opt = PC_OPEN | ((flags & (O_NOFOLLOW | O_EXCL)) ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW); - if (!(flags & O_NOCTTY) && fd > 2) + if (!(flags & O_NOCTTY) && fd > 2 && myself->ctty > 0) { flags |= O_NOCTTY; opt |= PC_CTTY; /* flag that, if opened, this fhandler could