* syscalls.cc (open): Semi-revert (?) to allowing open of a tty to become

controlling tty if there is no controlling tty.
This commit is contained in:
Christopher Faylor 2012-02-10 16:33:53 +00:00
parent 833630b859
commit 93b18fd232
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx>
* 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 <me.cygwin2012@cgf.cx>
* exceptions.cc (setup_handler): Reduce system_printf to sigproc_printf

View File

@ -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