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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to