From f8b62a47595264bca5888ceffa7c69ee036ed8a7 Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 29 Oct 2010 09:35:36 +0000 Subject: Return previous sigaction correctly. Submitted by: avg --- lib/libthr/thread/thr_sig.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index bb0ae0a..4acfe40 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -547,7 +547,10 @@ _sigaction(int sig, const struct sigaction * act, struct sigaction * oact) if (oldact.sa_handler != SIG_DFL && oldact.sa_handler != SIG_IGN) { - oldact = _thr_sigact[sig-1].sigact; + if (act != NULL) + oldact = oldact2; + else if (oact != NULL) + oldact = _thr_sigact[sig-1].sigact; } _thr_rwl_unlock(&_thr_sigact[sig-1].lock); -- cgit v1.1