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>2013-01-21 20:56:09 +0400
committerChristopher Faylor <me@cgf.cx>2013-01-21 20:56:09 +0400
commit3b1a8c572f8cea988ac1ede84000401f6d8c402e (patch)
treeef00f2014d32c58b3f0284a81263f356d64bf99a
parentdf0f949cfd63db5c3734224cdee426d03d7208ea (diff)
* 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.
-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\