X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=ce1974ba13e03b70e93a65f36324cf2d00a5165a;hb=ef001e787856eba2c526d318ffdbdd81ced7f144;hp=63f13aa24e8d31d0677c42dc8404937388a29741;hpb=74a6c3f57109f5924f734f66ead8ee1915a48803;p=lttng-tools.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 63f13aa24..ce1974ba1 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -66,11 +66,24 @@ function full_cleanup () # The '-' before the pid number ($$) indicates 'kill' to signal the # whole process group. trap - SIGTERM && kill -- -$$ + exit 1 } +function null_pipes () +{ + exec 0>/dev/null + exec 1>/dev/null + exec 2>/dev/null +} trap full_cleanup SIGINT SIGTERM +# perl prove closes its child pipes before giving it a chance to run its +# signal trap handlers. Redirect pipes to /dev/null if SIGPIPE is caught +# to allow those trap handlers to proceed. + +trap null_pipes SIGPIPE + function print_ok () { # Check if we are a terminal