aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-04-18 00:25:41 +0000
committerChristopher Faylor <me@cgf.cx>2003-04-18 00:25:41 +0000
commit4e837e7368b960191a231170f8716e1105e11dfa (patch)
treeb383295d93f0bef0971bd5ce710c04d0fcb50739 /winsup
parent09f7abda72c92dc0197643f5e01b40d7d384af65 (diff)
downloadnewlib-4e837e7368b960191a231170f8716e1105e11dfa.zip
newlib-4e837e7368b960191a231170f8716e1105e11dfa.tar.gz
newlib-4e837e7368b960191a231170f8716e1105e11dfa.tar.bz2
* syscalls.cc (setsid): Don't call FreeConsole if ctty is already < 0.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/syscalls.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0cfc976..8704d9e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2003-04-17 Christopher Faylor <cgf@redhat.com>
+
+ * syscalls.cc (setsid): Don't call FreeConsole if ctty is already < 0.
+
2003-04-17 Thomas Pfaff <tpfaff@gmx.net>
* Makefile.in: Add finline-functions optimization to CXXFLAGS.
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 4a7e20f..eb10550 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -283,13 +283,13 @@ setsid (void)
if (myself->pgid != myself->pid)
{
- myself->ctty = -1;
- if (fhandler_console::open_fhs <= 0)
+ if (myself->ctty >= 0 && fhandler_console::open_fhs <= 0)
{
syscall_printf ("open_fhs %d, freeing console",
fhandler_console::open_fhs);
FreeConsole ();
}
+ myself->ctty = -1;
myself->sid = getpid ();
myself->pgid = getpid ();
syscall_printf ("sid %d, pgid %d, ctty %d", myself->sid, myself->pgid, myself->ctty);