* syscalls.cc (setsid): Detach process from its console if the current
controlling tty is the console and already closed. * dtable.h (class dtable): Add members to count descriptors referring to the console. * dtable.cc (dtable::dec_console_fds): New function to detach process from its console. (dtable::release): Decrement the counter of console descriptors. (dtable::build_fhandler): Increment it. * exception.cc (ctrl_c_handler): Send SIGTERM to myself when catch CTRL_SHUTDOWN_EVENT.
This commit is contained in:
@@ -240,6 +240,8 @@ setsid (void)
|
||||
/* FIXME: for now */
|
||||
if (myself->pgid != _getpid ())
|
||||
{
|
||||
if (myself->ctty == TTY_CONSOLE && !cygheap->fdtab.has_console_fds ())
|
||||
FreeConsole ();
|
||||
myself->ctty = -1;
|
||||
myself->sid = _getpid ();
|
||||
myself->pgid = _getpid ();
|
||||
|
Reference in New Issue
Block a user