summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index b7207667f..f293901b8 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -1056,17 +1056,7 @@ do_exit (int status)
close_all_files ();
}
- if (exit_state < ES_SIGPROCTERMINATE)
- sigproc_terminate (); // sets exit_state directly
-
myself->stopsig = 0;
- if (exit_state < ES_TITLE)
- {
- exit_state = ES_TITLE;
- /* restore console title */
- if (old_title && display_title)
- set_console_title (old_title);
- }
if (exit_state < ES_HUP_PGRP)
{
@@ -1101,6 +1091,17 @@ do_exit (int status)
}
+ if (exit_state < ES_SIGPROCTERMINATE)
+ sigproc_terminate (ES_SIGPROCTERMINATE); // sets exit_state directly
+
+ if (exit_state < ES_TITLE)
+ {
+ exit_state = ES_TITLE;
+ /* restore console title */
+ if (old_title && display_title)
+ set_console_title (old_title);
+ }
+
if (exit_state < ES_TTY_TERMINATE)
{
exit_state = ES_TTY_TERMINATE;
@@ -1165,9 +1166,6 @@ __api_fatal (const char *fmt, ...)
WriteFile (h, buf, len, &done, 0);
}
- /* We are going down without mercy. Make sure we reset
- our process_state. */
- sigproc_terminate ();
#ifdef DEBUGGING
try_to_debug ();
#endif