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

xiaoxiang781216 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 1c798541f83 sched/signal: Fix the guards of the default action 
handlers.
1c798541f83 is described below

commit 1c798541f83c93e853de9135d1855bacd2c557d2
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Nov 8 14:17:54 2026 +0100

    sched/signal: Fix the guards of the default action handlers.
    
    The SIGURG entry of g_defactions[] uses nxsig_null_action(), but
    nxsig_null_action() is declared and defined only with
    CONFIG_SIG_SIGSTOP_ACTION.  A configuration with
    CONFIG_SIG_SIGURG_ACTION and without CONFIG_SIG_SIGSTOP_ACTION does not
    build.
    
    The SIGPROF entry uses nxsig_abnormal_termination(), but
    HAVE_NXSIG_ABNORMAL_TERMINANTION does not include
    CONFIG_SIG_SIGPROF_ACTION.  A configuration with only
    CONFIG_SIG_SIGPROF_ACTION of the termination actions does not build.
    
    Add HAVE_NXSIG_NULL_ACTION for the users of nxsig_null_action() and add
    CONFIG_SIG_SIGPROF_ACTION to HAVE_NXSIG_ABNORMAL_TERMINANTION.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 sched/signal/sig_default.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c
index 8a2747eabe6..f52a148ed3c 100644
--- a/sched/signal/sig_default.c
+++ b/sched/signal/sig_default.c
@@ -49,10 +49,15 @@
 
 #if defined(CONFIG_SIG_SIGUSR1_ACTION) || defined(CONFIG_SIG_SIGUSR2_ACTION) 
|| \
     defined(CONFIG_SIG_SIGALRM_ACTION) || defined(CONFIG_SIG_SIGPOLL_ACTION) 
|| \
-    defined(CONFIG_SIG_SIGKILL_ACTION) || defined(CONFIG_SIG_SIGPIPE_ACTION)
+    defined(CONFIG_SIG_SIGKILL_ACTION) || defined(CONFIG_SIG_SIGPIPE_ACTION) 
|| \
+    defined(CONFIG_SIG_SIGPROF_ACTION)
 #  define HAVE_NXSIG_ABNORMAL_TERMINANTION 1
 #endif
 
+#if defined(CONFIG_SIG_SIGSTOP_ACTION) || defined(CONFIG_SIG_SIGURG_ACTION)
+#  define HAVE_NXSIG_NULL_ACTION 1
+#endif
+
 /* Bit definitions for the struct nxsig_defaction_s 'flags' field */
 
 #define SIG_FLAG_NOCATCH (1 << 0)  /* Signal cannot be caught or ignored */
@@ -79,8 +84,10 @@ struct nxsig_defaction_s
 #ifdef HAVE_NXSIG_ABNORMAL_TERMINANTION
 static void nxsig_abnormal_termination(int signo);
 #endif
-#ifdef CONFIG_SIG_SIGSTOP_ACTION
+#ifdef HAVE_NXSIG_NULL_ACTION
 static void nxsig_null_action(int signo);
+#endif
+#ifdef CONFIG_SIG_SIGSTOP_ACTION
 static void nxsig_stop_task(int signo);
 #endif
 
@@ -190,7 +197,7 @@ static const struct nxsig_defaction_s g_defactions[] =
  *
  ****************************************************************************/
 
-#ifdef CONFIG_SIG_SIGSTOP_ACTION
+#ifdef HAVE_NXSIG_NULL_ACTION
 static void nxsig_null_action(int signo)
 {
 }

Reply via email to