Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jan 2016 22:42:10 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r294355 - head/tools/build
Message-ID:  <201601192242.u0JMgACq064709@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue Jan 19 22:42:10 2016
New Revision: 294355
URL: https://svnweb.freebsd.org/changeset/base/294355

Log:
  Validate that the file exists rather than obscure 'Not an elf file' error.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/tools/build/check-links.sh

Modified: head/tools/build/check-links.sh
==============================================================================
--- head/tools/build/check-links.sh	Tue Jan 19 22:42:07 2016	(r294354)
+++ head/tools/build/check-links.sh	Tue Jan 19 22:42:10 2016	(r294355)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601192242.u0JMgACq064709>