You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/09/15 21:08:38 UTC

[nuttx-apps] branch master updated: Fix sigprocmask 1. SIGSTOP and SIGKILL should not be used as test. In g_some_signals, SIGKILL is used.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9f2f86441 Fix sigprocmask 1. SIGSTOP and SIGKILL should not be used as test. In g_some_signals, SIGKILL is used.
9f2f86441 is described below

commit 9f2f86441d20cc04e6a0d7b95130d7d13f360f14
Author: TaiJuWu <tj...@gmail.com>
AuthorDate: Fri Sep 15 10:44:30 2023 +0000

    Fix sigprocmask
    1. SIGSTOP and SIGKILL should not be used as test. In g_some_signals,
    SIGKILL is used.
    
    2. The SIGSTOP and SIGKILL flags of current task are set so we need to
    delete them.
---
 testing/ostest/sigprocmask.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/testing/ostest/sigprocmask.c b/testing/ostest/sigprocmask.c
index 9e12c9077..b8b081291 100644
--- a/testing/ostest/sigprocmask.c
+++ b/testing/ostest/sigprocmask.c
@@ -44,11 +44,11 @@
 
 static int g_some_signals[NSIGNALS] =
 {
-  1,
-  3,
-  5,
-  7,
-  9
+  SIGHUP,
+  SIGQUIT,
+  SIGTRAP,
+  SIGBUS,
+  SIGUSR1
 };
 
 /****************************************************************************
@@ -223,6 +223,24 @@ void sigprocmask_test(void)
       goto errout_with_mask;
     }
 
+  ret = sigdelset(&currmask, SIGKILL);
+  if (ret != OK)
+    {
+      int errcode = errno;
+      printf("sigprocmask_test: ERROR sigprocmask failed: %d\n", errcode);
+      ASSERT(false);
+      goto errout_with_mask;
+    }
+
+  ret = sigdelset(&currmask, SIGSTOP);
+  if (ret != OK)
+    {
+      int errcode = errno;
+      printf("sigprocmask_test: ERROR sigprocmask failed: %d\n", errcode);
+      ASSERT(false);
+      goto errout_with_mask;
+    }
+
   /* It should be the same as newmask */
 
   if (memcmp(&currmask, &newmask, sizeof(sigset_t)) != 0)