summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-04-14 20:35:34 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-04-14 20:35:34 +0000
commit9ca6f883665aa57fc850fe3bf1e3e8a9b182acc9 (patch)
treeec55704dab3273d792ef96e38f5bd6b4b17ed734 /tests
parentb6820a451d2a9751cc88b9cfc3f71914eeca968a (diff)
downloadcoreutils-9ca6f883665aa57fc850fe3bf1e3e8a9b182acc9.tar.xz
(dot_mount_point): Use stat rather than df, as
it's more reliable. (other_partition_tmpdir): Remove df from name as that would be misleading now.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mv/setup12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/mv/setup b/tests/mv/setup
index 6b03482b6..591b80f23 100755
--- a/tests/mv/setup
+++ b/tests/mv/setup
@@ -1,6 +1,6 @@
#! /bin/sh
-# Use df to find a writable directory on a file system different from that
+# Use stat to find a writable directory on a file system different from that
# of the current directory. If one is found, create a temporary directory
# inside it.
@@ -9,22 +9,20 @@ test "${CANDIDATE_TMP_DIRS+set}" = set \
other_partition_tmpdir=
-# WARNING: using sed like this to extract the mount point will fail
-# if the mount point name contains `% '.
-dot_mount_point=`df --no-sync -P . | sed -n '2s/.*% *//p'`
+dot_mount_point=`stat -c %d .`
for d in $CANDIDATE_TMP_DIRS; do
# Skip nonexistent directories.
test -d $d || continue
- d_mount_point=`df --no-sync -P $d | sed -n '2s/.*% *//p'`
+ d_mount_point=`stat -c %d $d`
# Same partition? Skip it.
test x$d_mount_point = x$dot_mount_point && continue
# See if we can create a directory in it.
- if mkdir "$d/df-$$" > /dev/null 2>&1; then
- other_partition_tmpdir="$d/df-$$"
+ if mkdir "$d/tmp$$" > /dev/null 2>&1; then
+ other_partition_tmpdir="$d/tmp$$"
break
fi