Bug 1231320: ensure exit status is correct when cleaning up; r?armenzg
MozReview-Commit-ID: BHHy4lwAlwe
--- a/testing/taskcluster/scripts/builder/build-linux.sh
+++ b/testing/taskcluster/scripts/builder/build-linux.sh
@@ -40,19 +40,21 @@ export MOZ_SIMPLE_PACKAGE_NAME=target
# Ensure that in tree libraries can be found
export LIBRARY_PATH=$LIBRARY_PATH:$WORKSPACE/src/obj-firefox:$WORKSPACE/src/gcc/lib64
# test required parameters are supplied
if [[ -z ${MOZHARNESS_SCRIPT} ]]; then exit 1; fi
if [[ -z ${MOZHARNESS_CONFIG} ]]; then exit 1; fi
cleanup() {
+ local rv=$?
if [ -n "$xvfb_pid" ]; then
kill $xvfb_pid || true
fi
+ exit $rv
}
trap cleanup EXIT INT
# run mozharness in XVfb, if necessary; this is an array to maintain the quoting in the -s argument
if $NEED_XVFB; then
# Some mozharness scripts set DISPLAY=:2
Xvfb :2 -screen 0 1024x768x24 &
export DISPLAY=:2