Fix inability to add some signals to mask on NT (#596)

This commit is contained in:
Gavin Hayes 2022-09-06 21:35:26 -04:00 committed by GitHub
parent d861d2787b
commit 598640864a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -78,3 +78,18 @@ TEST(sigprocmask, testMultipleBlockedDeliveriesOfSameSignal) {
EXPECT_EQ(1, n);
}
}
TEST(sigprocmask, testBlockingSIGINT) {
sigset_t neu, old;
struct sigaction oldsigint;
struct sigaction sa = {.sa_sigaction = OnSig, .sa_flags = SA_SIGINFO};
n = 0;
sigemptyset(&neu);
sigaddset(&neu, SIGINT);
EXPECT_EQ(0, sigprocmask(SIG_BLOCK, &neu, &old));
ASSERT_EQ(0, sigaction(SIGINT, &sa, &oldsigint));
ASSERT_EQ(0, raise(SIGINT));
EXPECT_EQ(0, n);
EXPECT_EQ(0, sigprocmask(SIG_SETMASK, &old, NULL));
EXPECT_EQ(0, sigaction(SIGINT, &oldsigint, 0));
}