aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuís Henriques <lhenriques@suse.de>2021-11-09 17:55:55 +0000
committerEryu Guan <guaneryu@gmail.com>2021-11-14 19:24:41 +0800
commite429c4aa559926be86762c08a06ce2569731a170 (patch)
treed1907ebb21c732ba6715dd2f45bcec501dac5018
parentf5944cd0383e4e2affeb063ea1a7d21edea8bbd1 (diff)
downloadxfstests-dev-e429c4aa559926be86762c08a06ce2569731a170.tar.gz
common/renameat2: use mktemp(1) to create temporary directory
Instead of using $TEST_DIR/$$, use the _correct_ way to create temporary directories. I've seen generic/626 failing with: QA output created by 626 mkdir: cannot create directory '/media/test/471': File exists Silence is golden which was likely due to another test that used the same directory name and didn't do the clean-up. Signed-off-by: Luís Henriques <lhenriques@suse.de> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r--common/renameat23
1 files changed, 1 insertions, 2 deletions
diff --git a/common/renameat2 b/common/renameat2
index 4d25d7cebf..9737dff54a 100644
--- a/common/renameat2
+++ b/common/renameat2
@@ -105,14 +105,13 @@ _rename_tests()
_require_renameat2()
{
local flags=$1
- local rename_dir=$TEST_DIR/$$
+ local rename_dir=`mktemp -d -p $TEST_DIR`
local cmd=""
if test ! -x $here/src/renameat2; then
_notrun "renameat2 binary not found"
fi
- mkdir $rename_dir
touch $rename_dir/foo
case $flags in
"noreplace")