aboutsummaryrefslogtreecommitdiff
path: root/signal
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2024-03-11 15:13:09 +0100
committerAndreas Schwab <schwab@suse.de>2024-03-12 10:00:22 +0100
commit2173173d57971d042c0ad4b281431ae127e9b5b8 (patch)
tree5adeba44bb88ebdb80cdf9f76d7a00f126efceff /signal
parentaeee41f1cf9bf58d3d316af36bb7f5a8699ab129 (diff)
downloadglibc-2173173d57971d042c0ad4b281431ae127e9b5b8.zip
glibc-2173173d57971d042c0ad4b281431ae127e9b5b8.tar.gz
glibc-2173173d57971d042c0ad4b281431ae127e9b5b8.tar.bz2
linux/sigsetops: fix type confusion (bug 31468)
Each mask in the sigset array is an unsigned long, so fix __sigisemptyset to use that instead of int. The __sigword function returns a simple array index, so it can return int instead of unsigned long.
Diffstat (limited to 'signal')
-rw-r--r--signal/tst-sigisemptyset.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/signal/tst-sigisemptyset.c b/signal/tst-sigisemptyset.c
index f5e35e8..11e7f39 100644
--- a/signal/tst-sigisemptyset.c
+++ b/signal/tst-sigisemptyset.c
@@ -89,6 +89,17 @@ do_test (void)
TEST_COMPARE (sigisemptyset (&set), 1);
}
+ {
+ sigset_t set;
+ for (int sig = 1; sig <= NSIG; sig++)
+ {
+ sigemptyset (&set);
+ if (sigaddset (&set, sig) < 0)
+ continue;
+ TEST_COMPARE (sigisemptyset (&set), 0);
+ }
+ }
+
return 0;
}