summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-10-29 09:35:36 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-10-29 09:35:36 +0000
commitf8b62a47595264bca5888ceffa7c69ee036ed8a7 (patch)
treed17e06141653edb71ded7c52e597a772c3cea88f /lib
parentfa0e722e161a7e109d0c8582889ff2f7b5e8ca41 (diff)
downloadFreeBSD-src-f8b62a47595264bca5888ceffa7c69ee036ed8a7.zip
FreeBSD-src-f8b62a47595264bca5888ceffa7c69ee036ed8a7.tar.gz
Return previous sigaction correctly.
Submitted by: avg
Diffstat (limited to 'lib')
-rw-r--r--lib/libthr/thread/thr_sig.c5
1 files changed, 4 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud