aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_sig.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2010-10-29 07:04:45 +0000
committerDavid Xu <davidxu@FreeBSD.org>2010-10-29 07:04:45 +0000
commit322a8adaa3e3179d18b54435e19ae3cec0370f6d (patch)
treedf3460aeaa6e855b7aea20cc9382522430ee8324 /lib/libthr/thread/thr_sig.c
parent49939626beb04f2797147f55cf1e1997a1d8e040 (diff)
downloadsrc-322a8adaa3e3179d18b54435e19ae3cec0370f6d.tar.gz
src-322a8adaa3e3179d18b54435e19ae3cec0370f6d.zip
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.
Notes
Notes: svn path=/head/; revision=214500
Diffstat (limited to 'lib/libthr/thread/thr_sig.c')
-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 a2c1e530f774..bb0ae0a37ac0 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));