diff options
author | Christopher Faylor <me@cgf.cx> | 2001-07-26 00:10:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-07-26 00:10:52 +0000 |
commit | 0cc642a5f1b2121b4a451dfcd25fd98384f694c9 (patch) | |
tree | 4250d61796a5bcaa3304a691c988e7430c0e6d81 /winsup/cygwin/syscalls.cc | |
parent | 811bf2902df2465fef297c82be03ed5c1fcbd0fa (diff) | |
download | cygnal-0cc642a5f1b2121b4a451dfcd25fd98384f694c9.tar.gz cygnal-0cc642a5f1b2121b4a451dfcd25fd98384f694c9.tar.bz2 cygnal-0cc642a5f1b2121b4a451dfcd25fd98384f694c9.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index c8b9cb406..7e37278da 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -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 (); |