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

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

commit 9c80011c5376447a33ad7aee65a080d9cb92841a
Author: wangchengdong <[email protected]>
AuthorDate: Thu Feb 26 11:18:00 2026 +0800

    sched/signal: update nxsig_clockwait() to support disable all signals
    
    Update nxsig_clockwait() to handle the case where all signals functions
    are disabled.
    
    Signed-off-by: Chengdong Wang <[email protected]>
---
 sched/signal/CMakeLists.txt  | 36 ++++++++++++++++++------------------
 sched/signal/Make.defs       |  9 ++++++---
 sched/signal/sig_clockwait.c | 10 ++++++++--
 3 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/sched/signal/CMakeLists.txt b/sched/signal/CMakeLists.txt
index 31c32c44a10..a9595309737 100644
--- a/sched/signal/CMakeLists.txt
+++ b/sched/signal/CMakeLists.txt
@@ -20,25 +20,25 @@
 #
 # 
##############################################################################
 
+set(SRCS sig_nanosleep.c sig_usleep.c sig_sleep.c sig_clockwait.c)
+
 if(NOT CONFIG_DISABLE_ALL_SIGNALS)
-  set(SRCS
-      sig_procmask.c
-      sig_suspend.c
-      sig_kill.c
-      sig_tgkill.c
-      sig_queue.c
-      sig_waitinfo.c
-      sig_timedwait.c
-      sig_lowest.c
-      sig_notification.c
-      sig_dispatch.c
-      sig_pause.c
-      sig_clockwait.c
-      sig_nanosleep.c
-      sig_usleep.c
-      sig_sleep.c
-      sig_ppoll.c
-      sig_pselect.c)
+  list(
+    APPEND
+    SRCS
+    sig_procmask.c
+    sig_suspend.c
+    sig_kill.c
+    sig_tgkill.c
+    sig_queue.c
+    sig_waitinfo.c
+    sig_timedwait.c
+    sig_lowest.c
+    sig_notification.c
+    sig_dispatch.c
+    sig_pause.c
+    sig_ppoll.c
+    sig_pselect.c)
 endif()
 
 if(CONFIG_ENABLE_ALL_SIGNALS)
diff --git a/sched/signal/Make.defs b/sched/signal/Make.defs
index 7117c527655..e1099a4ebc1 100644
--- a/sched/signal/Make.defs
+++ b/sched/signal/Make.defs
@@ -19,11 +19,14 @@
 # under the License.
 #
 ############################################################################
+
+CSRCS += sig_nanosleep.c sig_sleep.c sig_usleep.c sig_clockwait.c
+
 ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
-CSRCS += sig_dispatch.c sig_kill.c sig_lowest.c sig_nanosleep.c
+CSRCS += sig_dispatch.c sig_kill.c sig_lowest.c
 CSRCS += sig_notification.c sig_pause.c sig_ppoll.c sig_procmask.c
-CSRCS += sig_pselect.c sig_queue.c sig_sleep.c sig_suspend.c sig_tgkill.c
-CSRCS += sig_timedwait.c sig_usleep.c sig_waitinfo.c sig_clockwait.c
+CSRCS += sig_pselect.c sig_queue.c  sig_suspend.c sig_tgkill.c
+CSRCS += sig_timedwait.c sig_waitinfo.c
 endif
 
 ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y)
diff --git a/sched/signal/sig_clockwait.c b/sched/signal/sig_clockwait.c
index 92a6859d7db..8d295be9468 100644
--- a/sched/signal/sig_clockwait.c
+++ b/sched/signal/sig_clockwait.c
@@ -109,17 +109,23 @@ void nxsig_wait_irq(FAR struct tcb_s *wtcb, uint8_t signo,
 {
   FAR struct tcb_s *rtcb = this_task();
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  UNUSED(signo);
+  UNUSED(code);
+  UNUSED(errcode);
+#else
   if (wtcb->sigunbinfo != NULL)
     {
       wtcb->sigunbinfo->si_signo           = signo;
       wtcb->sigunbinfo->si_code            = code;
       wtcb->sigunbinfo->si_errno           = errcode;
       wtcb->sigunbinfo->si_value.sival_int = 0;
-#ifdef CONFIG_SCHED_HAVE_PARENT
+#  ifdef CONFIG_SCHED_HAVE_PARENT
       wtcb->sigunbinfo->si_pid             = 0;  /* Not applicable */
       wtcb->sigunbinfo->si_status          = OK;
-#endif
+#  endif
     }
+#endif
 
   /* Remove the task from waiting list */
 

Reply via email to