summaryrefslogtreecommitdiffstats
path: root/tools/build
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-01-19 22:42:10 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-01-19 22:42:10 +0000
commitced78889471e1d8dc5167c73591afb479605b9b1 (patch)
tree572f7e9d63a8784087a541511cdd73d9bb9c4fb8 /tools/build
parent6a65b1568ab2f1720e59f5a90efd4d6d007f43a0 (diff)
downloadFreeBSD-src-ced78889471e1d8dc5167c73591afb479605b9b1.zip
FreeBSD-src-ced78889471e1d8dc5167c73591afb479605b9b1.tar.gz
Validate that the file exists rather than obscure 'Not an elf file' error.
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'tools/build')
-rwxr-xr-xtools/build/check-links.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/build/check-links.sh b/tools/build/check-links.sh
index 57c9437..80e1ad1 100755
--- a/tools/build/check-links.sh
+++ b/tools/build/check-links.sh
@@ -29,6 +29,11 @@ while getopts "Uv" flag; do
done
shift $((OPTIND-1))
+if ! [ -f "$1" ]; then
+ echo "No such file or directory: $1" >&2
+ exit 1
+fi
+
mime=$(file -L --mime-type $1)
isbin=0
case $mime in
OpenPOWER on IntegriCloud