From 6ed79f06f4eed9e19122300b313c4f596f272dc2 Mon Sep 17 00:00:00 2001 From: David Xu Date: Fri, 29 Oct 2010 09:35:36 +0000 Subject: [PATCH] Return previous sigaction correctly. Submitted by: avg --- lib/libthr/thread/thr_sig.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index bb0ae0a37ac..4acfe4017ef 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);