summaryrefslogtreecommitdiffstats
path: root/testsuite/scripts/hardlinks-p.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtestsuite/scripts/hardlinks-p.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/scripts/hardlinks-p.sh b/testsuite/scripts/hardlinks-p.sh
new file mode 100755
index 0000000..a9a3020
--- /dev/null
+++ b/testsuite/scripts/hardlinks-p.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+hardlinks=$(find -samefile "$1")
+
+for f in "$@"; do
+ found=false
+ for hl in $hardlinks; do
+ if [ "$hl" = "./$f" ]; then
+ found=true
+ break
+ fi
+ done
+ if ! $found; then
+ exit 1
+ fi
+done