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.
This commit is contained in:
David Xu 2010-10-29 07:04:45 +00:00
parent 49939626be
commit 322a8adaa3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214500

View File

@ -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));