Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
c1cdd265
by Moritz Angermann at 2025-09-10T10:48:35-04:00
1 changed file:
Changes:
| ... | ... | @@ -2,8 +2,11 @@ |
| 2 | 2 | #include <stdio.h>
|
| 3 | 3 | #include <errno.h>
|
| 4 | 4 | |
| 5 | -// Prints the state of the signal handlers to stdout
|
|
| 6 | -int main()
|
|
| 5 | +// Prints the state of the signal handlers to stdout.
|
|
| 6 | +// NOTE: We intentionally start at signal 1 (not 0). Signal number 0 is not a
|
|
| 7 | +// real signal; passing 0 to sigismember/sigaction is undefined behaviour and
|
|
| 8 | +// on Darwin was observed to yield memory corruption / junk bytes in output.
|
|
| 9 | +int main(void)
|
|
| 7 | 10 | {
|
| 8 | 11 | int open = 0, i;
|
| 9 | 12 | sigset_t blockedsigs;
|
| ... | ... | @@ -11,7 +14,7 @@ int main() |
| 11 | 14 | printf("ChildInfo { masked = [");
|
| 12 | 15 | |
| 13 | 16 | sigprocmask(SIG_BLOCK, NULL, &blockedsigs);
|
| 14 | - for(i = 0; i < NSIG; ++i)
|
|
| 17 | + for(i = 1; i < NSIG; ++i)
|
|
| 15 | 18 | {
|
| 16 | 19 | int ret = sigismember(&blockedsigs, i);
|
| 17 | 20 | if(ret >= 0)
|
| ... | ... | @@ -26,7 +29,7 @@ int main() |
| 26 | 29 | printf("], handlers = [");
|
| 27 | 30 | |
| 28 | 31 | open = 0;
|
| 29 | - for(i = 0; i < NSIG; ++i)
|
|
| 32 | + for(i = 1; i < NSIG; ++i)
|
|
| 30 | 33 | {
|
| 31 | 34 | struct sigaction old;
|
| 32 | 35 | if(sigaction(i, NULL, &old) >= 0)
|