From 799a9ef8d5a0cc93c0a85a152e04ecdb9f66beab Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Thu, 17 Apr 2025 12:49:31 +0200 Subject: [PATCH] Misc improvements. --- tests/signals/sigprocmask-3.c | 5 ++++- tests/signals/sigprocmask-blocksingle.c | 1 + tests/signals/sigrelse-1.c | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/signals/sigprocmask-3.c b/tests/signals/sigprocmask-3.c index 9bb7e1359e..aee43032ca 100644 --- a/tests/signals/sigprocmask-3.c +++ b/tests/signals/sigprocmask-3.c @@ -7,7 +7,7 @@ // The resulting set shall be the union of the current set and the signal // set pointed to by set, if the value of the argument how is SIG_BLOCK. -int handler_called = 0; +volatile sig_atomic_t handler_called = 0; void sig_handler(int signo) { @@ -45,12 +45,14 @@ int sigprocmask_block(int signum) status = sigprocmask(SIG_UNBLOCK, &set2, NULL); ERROR_IF(sigprocmask, status, == -1); + printf("Raising %s\n", strsignal(signum)); status = raise(signum); ERROR_IF(raise, status, == -1); ERROR_IF(raise, handler_called, != 1); handler_called = 0; + printf("Raising %s\n", strsignal(defaultsig)); status = raise(defaultsig); ERROR_IF(raise, defaultsig, == -1); @@ -78,6 +80,7 @@ int main(){ if (i == SIGKILL || i == SIGSTOP){ continue; } + printf("Testing signal %s (%d)\n", strsignal(i), i); sigprocmask_block(i); } return 0; diff --git a/tests/signals/sigprocmask-blocksingle.c b/tests/signals/sigprocmask-blocksingle.c index 2f8ffbe837..5dd3d5a3c0 100644 --- a/tests/signals/sigprocmask-blocksingle.c +++ b/tests/signals/sigprocmask-blocksingle.c @@ -56,6 +56,7 @@ int main(){ if (sig == SIGKILL || sig == SIGSTOP){ continue; } + printf("Testing signal %s (%d)\n", strsignal(i), i); sigprocmask_block(sig); } return EXIT_SUCCESS; diff --git a/tests/signals/sigrelse-1.c b/tests/signals/sigrelse-1.c index 5dca66c529..9d1cc402fe 100644 --- a/tests/signals/sigrelse-1.c +++ b/tests/signals/sigrelse-1.c @@ -1,5 +1,6 @@ // The sigrelse() function shall remove sig from the signal mask of the calling process. +#include #include #include #include @@ -10,7 +11,7 @@ #define _XOPEN_SOURCE 700 -int handler_called = 0; +volatile sig_atomic_t handler_called = 0; void sig_handler(int signo) { @@ -35,7 +36,7 @@ int sigrelse_test(int signum) status = raise(signum); ERROR_IF(raise, status, == -1); - ERROR_IF(raise, handler_called, == 1); + assert(handler_called == 0); // if (handler_called) { // printf("UNRESOLVED. possible problem in sigrelse\n"); // exit(EXIT_FAILURE); @@ -62,6 +63,7 @@ int main(){ if (i == SIGKILL || i == SIGSTOP){ continue; } + printf("For signal %s\n", strsignal(i)); sigrelse_test(i); } return 0;