summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/dcrt0.cc13
2 files changed, 18 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 93a8062a7..57969024f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx>
+ * dcrt0.cc (dll_crt0_1): Flag that we are working "incyg". Handle any
+ signals (presumably exiting signals) which may have come in while we
+ are in the process of setting up.
+
+2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx>
+
* update-copyright: Recognize configure.ac scripts too.
2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx>
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index cbe1b282f..931ebd9e8 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -820,6 +820,8 @@ dll_crt0_1 (void *)
{
extern void initial_setlocale ();
+ _my_tls.incyg++;
+
if (dynamically_loaded)
sigproc_init ();
@@ -987,7 +989,13 @@ dll_crt0_1 (void *)
/* Per POSIX set the default application locale back to "C". */
_setlocale_r (_REENT, LC_CTYPE, "C");
- if (user_data->main)
+ if (!user_data->main)
+ {
+ /* Handle any signals which may have arrived */
+ _my_tls.call_signal_handler ();
+ _my_tls.incyg--; /* Not in Cygwin anymore */
+ }
+ else
{
/* Create a copy of Cygwin's version of __argv so that, if the user makes
a change to an element of argv[] it does not affect Cygwin's argv.
@@ -998,6 +1006,9 @@ dll_crt0_1 (void *)
char **oav = __argv;
while ((*nav++ = *oav++) != NULL)
continue;
+ /* Handle any signals which may have arrived */
+ _my_tls.call_signal_handler ();
+ _my_tls.incyg--; /* Not in Cygwin anymore */
cygwin_exit (user_data->main (__argc, newargv, *user_data->envptr));
}
__asm__ (" \n\