* syscalls.cc (setsid): On second thought, in the spirit of keeping things
kludgy, set ctty to -2 here as a special flag, and... (open): ...only eschew setting O_NOCTTY when that case is detected.
This commit is contained in:
parent
93b18fd232
commit
c38a2d8373
|
@ -1,3 +1,9 @@
|
|||
2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx>
|
||||
|
||||
* syscalls.cc (setsid): On second thought, in the spirit of keeping
|
||||
things kludgy, set ctty to -2 here as a special flag, and...
|
||||
(open): ...only eschew setting O_NOCTTY when that case is detected.
|
||||
|
||||
2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx>
|
||||
|
||||
* syscalls.cc (open): Semi-revert (?) to allowing open of a tty to
|
||||
|
|
|
@ -1015,7 +1015,7 @@ setsid (void)
|
|||
syscall_printf ("hmm. pgid %d pid %d", myself->pgid, myself->pid);
|
||||
else
|
||||
{
|
||||
myself->ctty = -1;
|
||||
myself->ctty = -2;
|
||||
myself->sid = getpid ();
|
||||
myself->pgid = getpid ();
|
||||
if (cygheap->ctty)
|
||||
|
@ -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 && myself->ctty > 0)
|
||||
if (!(flags & O_NOCTTY) && fd > 2 && myself->ctty != -2)
|
||||
{
|
||||
flags |= O_NOCTTY;
|
||||
opt |= PC_CTTY; /* flag that, if opened, this fhandler could
|
||||
|
|
Loading…
Reference in New Issue