提交 1a93d0d7 编写于 作者: X x_xiny

signal

Change-Id: Iacf0cc5918e3aad5def71aedbd048bd5d21ccca5
上级 a6919e3f
......@@ -183,7 +183,19 @@ static void __sig_operation(unsigned int receivedSigno)
void arm_signal_process(unsigned int receivedSig)
{
sigset_t mask, oldmask;
sigemptyset(&mask);
sigemptyset(&oldmask);
sigaddset(&mask, receivedSig);
sigprocmask(SIG_BLOCK, &mask, NULL);
__sig_operation(receivedSig);
sigprocmask(SIG_BLOCK, NULL, &oldmask);
sigdelset(&oldmask, receivedSig);
sigprocmask(SIG_SETMASK, &oldmask, NULL);
}
static void __sig_add_def_action()
......@@ -255,6 +267,7 @@ static int __sig_action_opr(int sig, const sigaction_t *act, sigaction_t *oact)
sigact->act.sa_mask = act->sa_mask;
sigact->act.sa_flags = act->sa_flags;
}
sigprocmask(SIG_BLOCK, &act->sa_mask, NULL);
pthread_spin_unlock(&sig_lite_lock);
return ret;
}
......
......@@ -3,5 +3,22 @@
int sigsuspend(const sigset_t *mask)
{
return syscall_cp(SYS_rt_sigsuspend, mask, _NSIG/8);
}
int ret,retval;
sigset_t oldset;
retval = sigprocmask(SIG_BLOCK, 0, &oldset);
if (retval != 0){
return retval;
}
ret = syscall_cp(SYS_rt_sigsuspend, mask, _NSIG/8);
if (ret == -1){
retval = sigprocmask(SIG_SETMASK, &oldset, 0);
if (retval != 0){
return retval;
}
}
return ret;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册