* syscalls.cc (setsid): Don't call FreeConsole if ctty is already < 0.

This commit is contained in:
Christopher Faylor 2003-04-18 00:25:41 +00:00
parent 09f7abda72
commit 4e837e7368
2 changed files with 6 additions and 2 deletions

View File

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

View File

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