This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Use build directory instead of /tmp in globtest.sh
On Tue, 23 Oct 2012, Roland McGrath wrote:
> `pwd` is the source directory. You need to use ${objdir}.
Here is a version using ${common_objpfx}posix, since that's the form
in which the build directory is available in this script - and, since
my previous fix to ftwtest appears to have the same issue, a
corresponding patch to make that test use the build directory as well.
Tested x86_64.
2012-10-23 Joseph Myers <joseph@codesourcery.com>
* posix/globtest.sh (TMPDIR): Do not set.
(testdir): Define using ${common_objpfx}posix not $TMPDIR.
(testout): Likewise.
diff --git a/posix/globtest.sh b/posix/globtest.sh
index 29277a4..ea947b8 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -42,9 +42,10 @@ LANG=C
export LANG
# Create the arena
-: ${TMPDIR=/tmp}
-testdir=$(mktemp -d $TMPDIR/globtest-dir.XXXXXX)
-testout=$(mktemp $TMPDIR/globtest-out.XXXXXX)
+testdir=${common_objpfx}posix/globtest-dir
+testout=${common_objpfx}posix/globtest-out
+rm -rf $testdir $testout
+mkdir $testdir
trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
2012-10-23 Joseph Myers <joseph@codesourcery.com>
* io/ftwtest-sh (tmp): Define to ${objpfx}io, not using `pwd`.
diff --git a/io/ftwtest-sh b/io/ftwtest-sh
index adc6667..3bbf306 100644
--- a/io/ftwtest-sh
+++ b/io/ftwtest-sh
@@ -44,7 +44,7 @@ LANG=C
export LANG
# First create our scenario:
-tmp=`pwd | sed 's|\(.\)/*$|\1|'`
+tmp=${objpfx}io
tmpdir=$tmp/ftwtest.d
trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
--
Joseph S. Myers
joseph@codesourcery.com