diff options
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 3d6b7a89b..29d11f8e4 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -542,8 +542,12 @@ initial_env () buf[0] = '\0'; len = GetModuleFileName (NULL, buf, CYG_MAX_PATH); console_printf ("Sleeping %d, pid %u %s\n", ms, GetCurrentProcessId (), buf); - while (ms--) - Sleep (1); + Sleep (ms); + if (!strace.active) + { + strace.inited = 0; + strace.hello (); + } } if (GetEnvironmentVariable ("CYGWIN_DEBUG", buf, sizeof (buf) - 1)) { @@ -573,7 +577,6 @@ void __stdcall dll_crt0_0 () { wincap.init (); - initial_env (); char zeros[sizeof (child_proc_info->zero)] = {0}; @@ -719,6 +722,7 @@ dll_crt0_1 (char *) /* FIXME: Verify forked children get their exception handler set up ok. */ exception_list cygwin_except_entry; + initial_env (); check_sanity_and_sync (user_data); malloc_init (); @@ -1042,9 +1046,13 @@ do_exit (int status) /* Kill orphaned children on group leader exit */ if (myself->has_pgid_children && myself->pid == myself->pgid) { + siginfo_t si; + si.si_signo = -SIGHUP; + si.si_code = SI_KERNEL; + si.si_pid = si.si_uid = si.si_errno = 0; sigproc_printf ("%d == pgrp %d, send SIG{HUP,CONT} to stopped children", myself->pid, myself->pgid); - kill_pgrp (myself->pgid, -SIGHUP); + kill_pgrp (myself->pgid, si); } } |