From 9f2f86441d20cc04e6a0d7b95130d7d13f360f14 Mon Sep 17 00:00:00 2001 From: TaiJuWu Date: Fri, 15 Sep 2023 10:44:30 +0000 Subject: [PATCH] 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)