diff options
author | davidxu <davidxu@FreeBSD.org> | 2010-10-29 09:35:36 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2010-10-29 09:35:36 +0000 |
commit | f8b62a47595264bca5888ceffa7c69ee036ed8a7 (patch) | |
tree | d17e06141653edb71ded7c52e597a772c3cea88f /lib | |
parent | fa0e722e161a7e109d0c8582889ff2f7b5e8ca41 (diff) | |
download | FreeBSD-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.c | 5 |
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); |