diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-02-04 11:18:34 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-02-04 11:21:58 -0500 |
commit | 532dec0849dcdc3e15e530ac40a8168f146a41cd (patch) | |
tree | 6c8187fe8deea92d1b312c74174831d8c977ecd7 | |
parent | d33271ccc835e79e945d06185e09fda4c3c3e2c5 (diff) | |
download | bfs-532dec0849dcdc3e15e530ac40a8168f146a41cd.tar.xz |
tests/posix/exec_sigmask: Make portable
The test was Linux-only, and didn't pass on at least mips64el due to a
different signal mask size. The new version should be fully portable,
but will hang forever on failure.
Link: https://buildd.debian.org/status/fetch.php?pkg=bfs&arch=mips64el&ver=4.0.5-1&stamp=1737761227&raw=0
-rw-r--r-- | tests/posix/exec_sigmask.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/posix/exec_sigmask.sh b/tests/posix/exec_sigmask.sh index e01c05e..d1192a4 100644 --- a/tests/posix/exec_sigmask.sh +++ b/tests/posix/exec_sigmask.sh @@ -1,4 +1,16 @@ # Regression test: restore the signal mask after fork() -test "$UNAME" = "Linux" || skip -bfs_diff /proc/self/status -exec grep '^SigBlk:' {} + +cd "$TEST" +mkfifo p1 p2 + +{ + # Get the PID of `sh` + read -r pid <p1 + # Send SIGTERM -- this will hang forever if signals are blocked + kill $pid +} & + +# Write the `sh` PID to p1, then hang reading p2 until we're killed +! invoke_bfs p1 -exec sh -c 'echo $$ >p1 && read -r _ <p2' {} + || fail + +wait |