aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2010-10-29 09:35:36 +0000
committerDavid Xu <davidxu@FreeBSD.org>2010-10-29 09:35:36 +0000
commit6ed79f06f4eed9e19122300b313c4f596f272dc2 (patch)
treed17e06141653edb71ded7c52e597a772c3cea88f /lib
parent322a8adaa3e3179d18b54435e19ae3cec0370f6d (diff)
downloadsrc-6ed79f06f4eed9e19122300b313c4f596f272dc2.tar.gz
src-6ed79f06f4eed9e19122300b313c4f596f272dc2.zip
Return previous sigaction correctly.
Submitted by: avg
Notes
Notes: svn path=/head/; revision=214506
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 bb0ae0a37ac0..4acfe4017ef2 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);