[devtools] fix a couple issues with xvfb-run
xvfb-run didn't quite clean up correctly after itself, because:
- dash doesn't run EXIT traps on signals
- if we don't run the command in the background, a TERM handler doesn't run
until the command exits
--- a/devtools/data/xvfb-run.sh Thu Mar 21 16:37:06 2013 +0100
+++ b/devtools/data/xvfb-run.sh Thu Mar 21 16:52:13 2013 +0100
@@ -140,7 +140,7 @@
fi
# tidy up after ourselves
-trap clean_up EXIT
+trap clean_up EXIT TERM
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
@@ -178,13 +178,8 @@
exit 1
done
-# Start the command and save its exit status.
-set +e
-DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
-RETVAL=$?
-set -e
-
-# Return the executed command's exit status.
-exit $RETVAL
+# Start the command
+DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 &
+wait $!
# vim:set ai et sts=4 sw=4 tw=80: