X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=d156f17dad99b81685c2c0f36760767c485f618b;hb=4e8ea4fa44fb7646f023f985d45035d1561720d8;hp=71ddaa2cb5ea5a5c0e814eb307d201dcb2189817;hpb=529bb942d15366eacc37f14df5d4404dfcd64893;p=lttng-tools.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 71ddaa2cb..d156f17da 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