signal/sig_dispatch: Add signal action, if task is in system call

The _unmasked_ signal action was never added if the task is in system call
and waiting for (a different) signal.

This fixes deliver especially for default signal actions / unmaskable
signals, like SIGTERM.
This commit is contained in:
Ville Juven 2023-03-13 12:17:42 +02:00 committed by Masayuki Ishikawa
parent a6c1ef3c52
commit 776e2d774f

View File

@ -321,8 +321,8 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
int masked; int masked;
int ret = OK; int ret = OK;
sinfo("TCB=%p signo=%d code=%d value=%d mask=%08" PRIx32 "\n", sinfo("TCB=%p pid=%d signo=%d code=%d value=%d mask=%08" PRIx32 "\n",
stcb, info->si_signo, info->si_code, stcb, stcb->pid, info->si_signo, info->si_code,
info->si_value.sival_int, stcb->sigprocmask); info->si_value.sival_int, stcb->sigprocmask);
DEBUGASSERT(stcb != NULL && info != NULL); DEBUGASSERT(stcb != NULL && info != NULL);
@ -404,6 +404,15 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
} }
leave_critical_section(flags); leave_critical_section(flags);
#ifdef CONFIG_LIB_SYSCALL
/* Must also add signal action if in system call */
if (masked == 0)
{
nxsig_add_pendingsignal(stcb, info);
}
#endif
} }
/* Its not one we are waiting for... Add it to the list of pending /* Its not one we are waiting for... Add it to the list of pending