[devtools] fix a couple issues with xvfb-run stable
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 21 Mar 2013 16:52:13 +0100
branchstable
changeset 8758 3a0d91237e2c
parent 8757 375acf527559
child 8759 cd68cd879def
child 8821 c4aa23af0baa
[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
devtools/data/xvfb-run.sh
--- 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: