From 1188465112a1a3c6acce9d370d448df70fd4fa4d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 1 Jul 2011 19:51:47 -0700 Subject: x11perfcomp should use mktemp instead of pid for tmp directory Signed-off-by: Alan Coopersmith --- configure.ac | 3 +++ x11perfcomp.in | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0e5c297..1b62a88 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,9 @@ AC_TYPE_SIGNAL # Define the installation directory for the x11 performance compare scripts AC_SUBST([x11perfcompdir], [$libdir/X11/x11perfcomp]) +# Checks for programs run by the scripts we install +AC_PATH_PROG(MKTEMP, mktemp) + # Checks for pkg-config packages PKG_CHECK_MODULES(X11PERF, x11 xmuu) diff --git a/x11perfcomp.in b/x11perfcomp.in index a541ddc..6956cf2 100644 --- a/x11perfcomp.in +++ b/x11perfcomp.in @@ -23,10 +23,17 @@ PATH="@x11perfcompdir@:/bin:/usr/bin:$PATH" export PATH +MKTEMP="@MKTEMP@" + set -e -tmp=${TMPDIR-/tmp}/rates.$$ +if [ "x$MKTEMP" != "x" ] && [ -x "$MKTEMP" ] ; then + tmp=`$MKTEMP -p /tmp -d rates.XXXXXX` + if [ "x$tmp" = "x" ]; then exit 1 ; fi +else + tmp=${TMPDIR-/tmp}/rates.$$ + mkdir $tmp || exit 1 +fi trap "rm -rf $tmp" 0 1 2 15 -mkdir $tmp || exit 1 mkdir $tmp/rates ratio= allfiles= -- cgit v1.2.3