HardenedBSD src tree https://hardenedbsd.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
361 B

  1. # $FreeBSD$
  2. T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX`
  3. trap 'rm -rf $T' 0
  4. cd $T || exit 3
  5. mkfifo fifo1
  6. # Use a trap, not the default action, since the shell may catch SIGINT and
  7. # therefore its processing may be delayed.
  8. { trap 'exit 5' TERM; read dummy <fifo1; exit 4; } &
  9. exec 3>fifo1
  10. kill -INT "$!"
  11. kill -TERM "$!"
  12. exec 3>&-
  13. wait "$!"
  14. r=$?
  15. [ "$r" = 5 ]