diff options
author | Christopher Faylor <me@cgf.cx> | 2013-01-21 16:56:09 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-01-21 16:56:09 +0000 |
commit | 3b1a8c572f8cea988ac1ede84000401f6d8c402e (patch) | |
tree | ef00f2014d32c58b3f0284a81263f356d64bf99a | |
parent | df0f949cfd63db5c3734224cdee426d03d7208ea (diff) | |
download | newlib-3b1a8c572f8cea988ac1ede84000401f6d8c402e.zip newlib-3b1a8c572f8cea988ac1ede84000401f6d8c402e.tar.gz newlib-3b1a8c572f8cea988ac1ede84000401f6d8c402e.tar.bz2 |
* 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/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 93a8062..5796902 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 cbe1b28..931ebd9 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\ |