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

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

commit 9ec6728ef8d54ab62fb5952df7502bcb60a74823
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Oct 18 12:58:02 2026 +0200

    netutils/dhcp6c: Use a handler for SIGQUIT in dhcp6c_cancel().
    
    dhcp6c_cancel() set SIGQUIT to SIG_IGN and sent it to the thread of
    dhcp6c_run() to break it out of a blocking call.  An ignored signal need
    not interrupt that call, and with CONFIG_SIG_DISCARD_IGNORED it does not.
    
    Set an empty handler instead of SIG_IGN.  The handler also keeps SIGQUIT
    from terminating the process, as SIG_IGN did.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 netutils/dhcp6c/dhcp6c.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/netutils/dhcp6c/dhcp6c.c b/netutils/dhcp6c/dhcp6c.c
index 931d484b3..5505f11b3 100644
--- a/netutils/dhcp6c/dhcp6c.c
+++ b/netutils/dhcp6c/dhcp6c.c
@@ -287,6 +287,20 @@ static const struct dhcp6c_retx_s 
g_dhcp6c_retx[DHCPV6_MSG_MAX] =
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: dhcp6c_wakeup
+ *
+ * Description:
+ *   An empty handler for SIGQUIT.  dhcp6c_cancel() sends SIGQUIT to break
+ *   dhcp6c_run() out of a blocking call; an ignored signal need not
+ *   interrupt it.
+ *
+ ****************************************************************************/
+
+static void dhcp6c_wakeup(int signo)
+{
+}
+
 static uint64_t dhcp6c_get_milli_time(void)
 {
   struct timespec t;
@@ -1921,7 +1935,7 @@ void dhcp6c_cancel(FAR void *handle)
       pdhcp6c->cancel = true;
       if (pdhcp6c->thread)
         {
-          old = signal(SIGQUIT, SIG_IGN);
+          old = signal(SIGQUIT, dhcp6c_wakeup);
 
           /* Signal the dhcp6c_run */
 

Reply via email to