File: exec_sigmask.sh

package info (click to toggle)
bfs 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,484 kB
  • sloc: ansic: 21,302; sh: 3,227; makefile: 221
file content (16 lines) | stat: -rw-r--r-- 371 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Regression test: restore the signal mask after fork()

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 bash -c 'echo $$ >p1 && read -r _ <p2' bash {} + || fail

_wait