summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--old/fileutils/ChangeLog21
-rwxr-xr-xtests/mv/hard-link-154
2 files changed, 75 insertions, 0 deletions
diff --git a/old/fileutils/ChangeLog b/old/fileutils/ChangeLog
index 429b5b1aa..d5136653d 100644
--- a/old/fileutils/ChangeLog
+++ b/old/fileutils/ChangeLog
@@ -1,5 +1,26 @@
+1998-11-29 Jim Meyering <meyering@ascend.com>
+
+ Per Kristian Hove reported that a certain move-directory-into-self
+ wasn't properly diagnosed.
+
+ * tests/mv/into-self-3: New file.
+ * tests/mv/Makefile.am (TESTS): Add into-self-3.
+ * src/copy.c (copy_internal): Remove earlier (but less effective)
+ test for move/copy-into-self.
+ Instead, deduce the move-into-self condition from errno==EINVAL
+ after a failed rename.
+ * src/mv.c (do_move): Don't arrange to remove DEST in the
+ copied-into-self case.
+
1998-11-15 Jim Meyering <meyering@ascend.com>
+ Bob McCracken reported that mv couldn't handle certain combinations
+ of hard linked source files.
+
+ * tests/mv/hard-link-1: New file.
+ * tests/mv/Makefile.am (TESTS): Add hard-link-1.
+ * src/mv.c (movefile): Don't free new_dest.
+
* lib/error.c (error): Don't use strerror_r's return value.
From Johan Danielsson.
diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1
new file mode 100755
index 000000000..0d6376529
--- /dev/null
+++ b/tests/mv/hard-link-1
@@ -0,0 +1,54 @@
+#!/bin/sh
+# move a directory containing hard-linked files and
+# make sure the links are preserved
+
+: ${MV=mv}
+: ${RM=rm}
+: ${MKDIR=mkdir}
+: ${LN=ln}
+: ${LS=ls}
+
+if test "$VERBOSE" = yes; then
+ set -x
+ $MV --version
+fi
+
+. $srcdir/setup
+
+if test -z "$other_partition_tmpdir"; then
+ exit 77
+fi
+
+dir=hlink
+
+framework_failure=0
+$MKDIR $dir || framework_failure=1
+> $dir/a || framework_failure=1
+$LN $dir/a $dir/b || framework_failure=1
+
+if test $framework_failure = 1; then
+ echo 'failure in testing framework'
+ exit 1
+fi
+
+# Make sure we get English translations.
+LANGUAGE=C
+export LANGUAGE
+LC_ALL=C
+export LC_ALL
+LANG=C
+export LANG
+
+$MV $dir $other_partition_tmpdir || fail=1
+
+# Display inode numbers, one per line.
+$LS -1i $other_partition_tmpdir/$dir > out || fail=1
+
+# Make sure the inode numbers are the same.
+a=`sed -n 's/ a$//p' out`
+b=`sed -n 's/ b$//p' out`
+test "$a" = "$b" || fail=1
+
+$RM -fr out $dir $other_partition_tmpdir
+
+exit $fail