diff options
author | Christopher Faylor <me@cgf.cx> | 2005-12-23 22:50:20 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-12-23 22:50:20 +0000 |
commit | dcd0465b2b7d8693d6ba6a4225487b84ef5930a7 (patch) | |
tree | 1b70ddafbdc6d5f8388fbcc0a66089aa0a315cec /winsup/cygwin/signal.cc | |
parent | ede284de5fccecbde8a2b0b70471eec4cc5cd3eb (diff) | |
download | cygnal-dcd0465b2b7d8693d6ba6a4225487b84ef5930a7.tar.gz cygnal-dcd0465b2b7d8693d6ba6a4225487b84ef5930a7.tar.bz2 cygnal-dcd0465b2b7d8693d6ba6a4225487b84ef5930a7.zip |
* cygtls.cc (_cygtls::handle_threadlist_exception): Make an error fatal.
* cygtls.h (sockaddr_in): Use header rather than defining our own structure.
* exceptions.cc (_cygtls::interrupt_setup): Use exact contents of sa_mask
rather than assuming tht current sig should be masked, too.
(_cygtls::call_signal_handler): Use more aggressive locking.
* gendef (_sigbe): Wait until later before releasing incyg.
(_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction support.
(_sigdelayed): Push arguments for sa_sigaction. More work needed here.
* signal.cc (sigaction): Implement SA_NODEFER.
* tlsoffsets.h: Regenerate.
* sigproc.cc (wait_sig): Use default buffer size of Windows 9x complains.
* pinfo.cc (_onreturn::dummy_handle): Remove.
(_onreturn::h): Make this a pointer.
(_onreturn::~_onreturn): Detect whether pointer is NULL rather than value is
NULL.
(_onreturn::_onreturn): Set h to NULL initially.
(_onreturn::no_close_p_handle): Set h to NULL.
(winpids::add): Initialize onreturn with value from p.hProcess immediately.
Diffstat (limited to 'winsup/cygwin/signal.cc')
-rw-r--r-- | winsup/cygwin/signal.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 01ba0bef0..09e8eee0e 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -257,6 +257,7 @@ killsys (pid_t pid, int sig) si.si_pid = si.si_uid = si.si_errno = 0; return kill0 (pid, si); } + int kill (pid_t pid, int sig) { @@ -356,28 +357,29 @@ sigaction (int sig, const struct sigaction *newact, struct sigaction *oldact) struct sigaction oa = global_sigs[sig]; - if (newact) - sigproc_printf ("signal %d, newact %p (handler %p), oa %p", sig, newact, newact->sa_handler, oa, oa.sa_handler); - else + if (!newact) sigproc_printf ("signal %d, newact %p, oa %p", sig, newact, oa, oa.sa_handler); - - if (newact) + else { + sigproc_printf ("signal %d, newact %p (handler %p), oa %p", sig, newact, newact->sa_handler, oa, oa.sa_handler); if (sig == SIGKILL || sig == SIGSTOP) { set_errno (EINVAL); return -1; } - global_sigs[sig] = *newact; - if (newact->sa_handler == SIG_IGN) + struct sigaction& na = global_sigs[sig]; + na = *newact; + if (!(na.sa_flags & SA_NODEFER)) + na.sa_mask |= SIGTOMASK(sig); + if (na.sa_handler == SIG_IGN) sig_clear (sig); - if (newact->sa_handler == SIG_DFL && sig == SIGCHLD) + if (na.sa_handler == SIG_DFL && sig == SIGCHLD) sig_clear (sig); - set_sigcatchers (oa.sa_handler, newact->sa_handler); + set_sigcatchers (oa.sa_handler, na.sa_handler); if (sig == SIGCHLD) { myself->process_state &= ~PID_NOCLDSTOP; - if (newact->sa_flags & SA_NOCLDSTOP) + if (na.sa_flags & SA_NOCLDSTOP) myself->process_state |= PID_NOCLDSTOP; } } |