From bbca1e4cb97050e1cc646730aedd8269f9474fc2 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 13 Mar 2006 18:29:48 +0000 Subject: * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a little later. Add a comment. * fork.cc (resume_child): Make void. (frok::parent): Only zero pi when necessary. Explicitly zero si. Set this_errno when child_copy fails. Accommodate change to resume_child. * sigproc.cc (sigalloc): Move global_sigs initialization here. (sigproc_init): Move global_sigs. (sig_send): Just check for flush signals once. * wincap.h: Define supports_setconsolectrlhandler_null throughout. * wincap.cc: Ditto. --- winsup/cygwin/sigproc.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'winsup/cygwin/sigproc.cc') diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 845f7cd80..c8f11324a 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -112,6 +112,7 @@ sigalloc () { cygheap->sigs = global_sigs = (struct sigaction *) ccalloc (HEAP_SIGS, NSIG, sizeof (struct sigaction)); + global_sigs[SIGSTOP].sa_flags = SA_RESTART | SA_NODEFER; } void __stdcall @@ -479,14 +480,12 @@ sigproc_init () ProtectHandle (wait_sig_inited); /* sync_proc_subproc is used by proc_subproc. It serialises - * access to the children and proc arrays. - */ + access to the children and proc arrays. */ sync_proc_subproc.init ("sync_proc_subproc"); hwait_sig = new cygthread (wait_sig, 0, cygself, "sig"); hwait_sig->zap_h (); - global_sigs[SIGSTOP].sa_flags = SA_RESTART | SA_NODEFER; sigproc_printf ("process/signal handling enabled, state %p", myself->process_state); } @@ -514,20 +513,20 @@ sig_send (_pinfo *p, int sig) sigheld = true; else if (!sigheld) /* nothing */; - else if (sig != __SIGNOHOLD && sig != __SIGFLUSH && sig != __SIGFLUSHFAST) - { -#ifdef DEBUGGING - system_printf ("internal signal sent while signals are on hold"); -#endif - return -1; - } else if (sig == __SIGFLUSH || sig == __SIGFLUSHFAST) return 0; - else + else if (sig == __SIGNOHOLD) { SetEvent (sigCONT); sigheld = false; } + else + { +#ifdef DEBUGGING + system_printf ("internal signal sent while signals are on hold"); +#endif + return -1; + } siginfo_t si = {0}; si.si_signo = sig; si.si_code = SI_KERNEL; -- cgit v1.2.3