X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=xvfb-run.sh;h=84ad0fc2ea84ce49e65463cf57d95a72fc5af1cd;hb=5cf95a8f9701e7d8b4701cf745bd1630a200cb3e;hp=c13c29d93a137ee8c89cd26a22b37a004622db97;hpb=57eaa155f318fa6c9984dc07995088cc1d50aa76;p=packages%2Fxorg-xserver-server.git diff --git a/xvfb-run.sh b/xvfb-run.sh index c13c29d..84ad0fc 100755 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -14,7 +14,7 @@ # GNU General Public License can be found in the file COPYING. # --- T2-COPYRIGHT-NOTE-END --- -# $Id: xvfb-run 2166 2005-01-27 07:54:19Z branden $ +# $Id$ # from: http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/xvfb-run # This script starts an instance of Xvfb, the "fake" X server, runs a command @@ -146,19 +146,17 @@ fi # If the user did not specify an X authorization file to use, set up a temporary # directory to house one. if [ -z "$AUTHFILE" ]; then - XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$" - if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then - error "temporary directory $XVFB_RUN_TMPDIR already exists" - exit 4 - fi - AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority) + XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)" + AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXX) fi # Start Xvfb. MCOOKIE=$(mcookie) -XAUTHORITY=$AUTHFILE xauth add ":$SERVERNUM" "$XAUTHPROTO" "$MCOOKIE" \ - >"$ERRORFILE" 2>&1 -XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >"$ERRORFILE" \ + +XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1 +add :$SERVERNUM $XAUTHPROTO $MCOOKIE +EOF +XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \ 2>&1 & XVFBPID=$! sleep "$STARTWAIT"