projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
390c00c
)
test sigsetjmp with savesigs=0
author
Bobby Bingham
<koorogi@koorogi.info>
Fri, 10 Nov 2017 20:59:01 +0000
(14:59 -0600)
committer
Szabolcs Nagy
<nsz@port70.net>
Wed, 7 Feb 2018 21:02:47 +0000
(21:02 +0000)
src/functional/setjmp.c
patch
|
blob
|
history
diff --git
a/src/functional/setjmp.c
b/src/functional/setjmp.c
index
0a9e4e6
..
adba1a6
100644
(file)
--- a/
src/functional/setjmp.c
+++ b/
src/functional/setjmp.c
@@
-46,5
+46,20
@@
int main(void)
sigprocmask(SIG_SETMASK, &set, &set);
TEST(sigismember(&set, SIGUSR1)==0, "siglongjmp failed to restore mask\n");
sigprocmask(SIG_SETMASK, &set, &set);
TEST(sigismember(&set, SIGUSR1)==0, "siglongjmp failed to restore mask\n");
+ sigemptyset(&set);
+ sigaddset(&set, SIGUSR1);
+ sigprocmask(SIG_UNBLOCK, &set, &set);
+ oldset = set;
+
+ if (!sigsetjmp(sjb, 0)) {
+ sigemptyset(&set);
+ sigaddset(&set, SIGUSR1);
+ sigprocmask(SIG_BLOCK, &set, 0);
+ siglongjmp(sjb, 1);
+ }
+ set = oldset;
+ sigprocmask(SIG_SETMASK, &set, &set);
+ TEST(sigismember(&set, SIGUSR1)==1, "siglongjmp incorrectly restored mask\n");
+
return t_status;
}
return t_status;
}