diff options
author | Christopher Faylor <me@cgf.cx> | 2012-02-10 20:43:36 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-02-10 20:43:36 +0400 |
commit | c38a2d83730311cad68d3c2d4759dfc18a3c64f3 (patch) | |
tree | 52d861cbb7be435aa758010c2a98f83669536281 /winsup/cygwin/syscalls.cc | |
parent | 93b18fd23229c9d8e50ad778f8069af9a3425e90 (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 27063ec23..539f3716f 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -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 |