diff options
author | davidxu <davidxu@FreeBSD.org> | 2010-10-29 07:04:45 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2010-10-29 07:04:45 +0000 |
commit | fa0e722e161a7e109d0c8582889ff2f7b5e8ca41 (patch) | |
tree | df3460aeaa6e855b7aea20cc9382522430ee8324 /lib/libthr | |
parent | d508714b76fdc127602a1c6ee49a838db87efaba (diff) | |
download | FreeBSD-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.
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_sig.c | 5 |
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)); |