This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 776e2d774f signal/sig_dispatch: Add signal action, if task is in 
system call
776e2d774f is described below

commit 776e2d774faac35c4583b6186e6c3e659fa4551f
Author: Ville Juven <ville.ju...@unikie.com>
AuthorDate: Mon Mar 13 12:17:42 2023 +0200

    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.
---
 sched/signal/sig_dispatch.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c
index 77d0c5ef71..8407251336 100644
--- a/sched/signal/sig_dispatch.c
+++ b/sched/signal/sig_dispatch.c
@@ -321,8 +321,8 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t 
*info)
   int masked;
   int ret = OK;
 
-  sinfo("TCB=%p signo=%d code=%d value=%d mask=%08" PRIx32 "\n",
-        stcb, info->si_signo, info->si_code,
+  sinfo("TCB=%p pid=%d signo=%d code=%d value=%d mask=%08" PRIx32 "\n",
+        stcb, stcb->pid, info->si_signo, info->si_code,
         info->si_value.sival_int, stcb->sigprocmask);
 
   DEBUGASSERT(stcb != NULL && info != NULL);
@@ -404,6 +404,15 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t 
*info)
             }
 
           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

Reply via email to