summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/syscalls.cc4
2 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 55a38b0fa..1c4c486c6 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
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
become controlling tty if there is no controlling tty.
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