summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-10-29 07:04:45 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-10-29 07:04:45 +0000
commitfa0e722e161a7e109d0c8582889ff2f7b5e8ca41 (patch)
treedf3460aeaa6e855b7aea20cc9382522430ee8324
parentd508714b76fdc127602a1c6ee49a838db87efaba (diff)
downloadFreeBSD-src-fa0e722e161a7e109d0c8582889ff2f7b5e8ca41.zip
FreeBSD-src-fa0e722e161a7e109d0c8582889ff2f7b5e8ca41.tar.gz
Remove local variable 'first', instead check signal number in memory,
because the variable can be in register, second checking the variable may still return true, however this is unexpected.
-rw-r--r--lib/libthr/thread/thr_sig.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index a2c1e53..bb0ae0a 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -317,14 +317,11 @@ check_deferred_signal(struct pthread *curthread)
ucontext_t uc;
struct sigaction act;
siginfo_t info;
- volatile int first;
if (__predict_true(curthread->deferred_siginfo.si_signo == 0))
return;
- first = 1;
getcontext(&uc);
- if (first) {
- first = 0;
+ if (curthread->deferred_siginfo.si_signo == 0) {
act = curthread->deferred_sigact;
uc.uc_sigmask = curthread->deferred_sigmask;
memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t));
OpenPOWER on IntegriCloud