Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-07-26 04:10:52 +0400
committerChristopher Faylor <me@cgf.cx>2001-07-26 04:10:52 +0400
commit0cc642a5f1b2121b4a451dfcd25fd98384f694c9 (patch)
tree4250d61796a5bcaa3304a691c988e7430c0e6d81 /winsup/cygwin/exceptions.cc
parent811bf2902df2465fef297c82be03ed5c1fcbd0fa (diff)
* 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/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 3c9198475..7a2061aa5 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -895,14 +895,20 @@ ctrl_c_handler (DWORD type)
if (type == CTRL_LOGOFF_EVENT)
return TRUE;
- if ((type == CTRL_CLOSE_EVENT) || (type == CTRL_SHUTDOWN_EVENT))
- /* Return FALSE to prevent an "End task" dialog box from appearing
- for each Cygwin process window that's open when the computer
- is shut down or console window is closed. */
+ /* Return FALSE to prevent an "End task" dialog box from appearing
+ for each Cygwin process window that's open when the computer
+ is shut down or console window is closed. */
+ if (type == CTRL_SHUTDOWN_EVENT)
+ {
+ sig_send (NULL, SIGTERM);
+ return FALSE;
+ }
+ if (type == CTRL_CLOSE_EVENT)
{
sig_send (NULL, SIGHUP);
return FALSE;
}
+
tty_min *t = cygwin_shared->tty.get_tty (myself->ctty);
/* Ignore this if we're not the process group lead since it should be handled
*by* the process group leader. */