diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ee2d482b4..c5dce4733 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2010-09-12 Christopher Faylor + + * cygthread.h (cygthread::cygthread): Reorganize slightly. + * dcrt0.cc (dll_crt0_0): Move sigproc initialization later to ensure + everything we need has been set up. + (dll_crt0_1): Streamline some logic slightly. + * sigproc.cc (no_signals_available): Add back dropped test for macro + parameter. + * fhandler_console.cc (fhandler_console::write): Show a little bit of + what's being written to the console in debugging output. + 2010-09-12 Corinna Vinschen * syscalls.cc (start_transaction): Make inline function. Move up to be diff --git a/winsup/cygwin/cygthread.h b/winsup/cygwin/cygthread.h index cf1fd4102..e9dba0d5c 100644 --- a/winsup/cygwin/cygthread.h +++ b/winsup/cygwin/cygthread.h @@ -43,7 +43,8 @@ class cygthread void auto_release () {func = NULL;} void release (bool); cygthread (LPTHREAD_START_ROUTINE start, unsigned n, LPVOID param, const char *name, HANDLE notify = NULL) - : __name (name), func (start), arglen (n), arg (param), notify_detached (notify), standalone (false) + : __name (name), func (start), arglen (n), arg (param), + notify_detached (notify), standalone (false) { create (); } @@ -57,7 +58,8 @@ class cygthread zap_h (); } cygthread (LPTHREAD_START_ROUTINE start, LPVOID param, const char *name, HANDLE notify = NULL) - : __name (name), func (start), arglen (0), arg (param), notify_detached (notify), standalone (false) + : __name (name), func (start), arglen (0), arg (param), + notify_detached (notify), standalone (false) { create (); } diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index c84b06f7b..b539e4b7f 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -740,12 +740,6 @@ dll_crt0_0 () } } - /* Initialize signal processing here, early, in the hopes that the creation - of a thread early in the process will cause more predictability in memory - layout for the main thread. */ - if (!dynamically_loaded) - sigproc_init (); - user_data->threadinterface->Init (); _cygtls::init (); @@ -777,6 +771,12 @@ dll_crt0_0 () disable_dep (); #endif + /* Initialize signal processing here, early, in the hopes that the creation + of a thread early in the process will cause more predictability in memory + layout for the main thread. */ + if (!dynamically_loaded) + sigproc_init (); + debug_printf ("finished dll_crt0_0 initialization"); } @@ -940,25 +940,21 @@ dll_crt0_1 (void *) for (unsigned int i = PREMAIN_LEN / 2; i < PREMAIN_LEN; i++) user_data->premain[i] (__argc, __argv, user_data); - debug_printf ("user_data->main %p", user_data->main); + set_errno (0); if (dynamically_loaded) - { - set_errno (0); - return; - } + return; /* Disable case-insensitive globbing */ ignore_case_with_glob = false; - set_errno (0); - MALLOC_CHECK; cygbench (__progname); ld_preload (); /* Per POSIX set the default application locale back to "C". */ _setlocale_r (_REENT, LC_CTYPE, "C"); + if (user_data->main) cygwin_exit (user_data->main (__argc, __argv, *user_data->envptr)); __asm__ (" \n\ diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 8aebaccf8..d0c4d6ac4 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1987,7 +1987,7 @@ fhandler_console::write (const void *vsrc, size_t len) } } - syscall_printf ("%d = fhandler_console::write (,..%d)", len, len); + syscall_printf ("%d = fhandler_console::write (\".20s\")", len, vsrc); return len; } diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 17a18ffe0..42f116e96 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -33,7 +33,7 @@ details. */ #define WSSC 60000 // Wait for signal completion #define WPSP 40000 // Wait for proc_subproc mutex -#define no_signals_available(x) (!my_sendsig ||( myself->exitcode & EXITCODE_SET) || (&_my_tls == _sig_tls) || !cygwin_finished_initializing) +#define no_signals_available(x) (!my_sendsig || ((x) && myself->exitcode & EXITCODE_SET) || (&_my_tls == _sig_tls)) #define NPROCS 256