devtools/data/xvfb-run.sh
branchstable
changeset 8758 3a0d91237e2c
parent 8339 63348ead09fb
child 8884 e750e5abd1c7
equal deleted inserted replaced
8757:375acf527559 8758:3a0d91237e2c
   138     error "xauth command not found"
   138     error "xauth command not found"
   139     exit 3
   139     exit 3
   140 fi
   140 fi
   141 
   141 
   142 # tidy up after ourselves
   142 # tidy up after ourselves
   143 trap clean_up EXIT
   143 trap clean_up EXIT TERM
   144 
   144 
   145 # If the user did not specify an X authorization file to use, set up a temporary
   145 # If the user did not specify an X authorization file to use, set up a temporary
   146 # directory to house one.
   146 # directory to house one.
   147 if [ -z "$AUTHFILE" ]; then
   147 if [ -z "$AUTHFILE" ]; then
   148     XVFB_RUN_TMPDIR="$(mktemp -d -t $PROGNAME.XXXXXX)"
   148     XVFB_RUN_TMPDIR="$(mktemp -d -t $PROGNAME.XXXXXX)"
   176     error "Xvfb failed to start" >&2
   176     error "Xvfb failed to start" >&2
   177     XVFBPID=
   177     XVFBPID=
   178     exit 1
   178     exit 1
   179 done
   179 done
   180 
   180 
   181 # Start the command and save its exit status.
   181 # Start the command
   182 set +e
   182 DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 &
   183 DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
   183 wait $!
   184 RETVAL=$?
       
   185 set -e
       
   186 
       
   187 # Return the executed command's exit status.
       
   188 exit $RETVAL
       
   189 
   184 
   190 # vim:set ai et sts=4 sw=4 tw=80:
   185 # vim:set ai et sts=4 sw=4 tw=80: