From 7a401a0df37dd6d55bf20b75ddf977f1b14c98f7 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Tue, 18 Nov 2008 22:00:42 +0000 Subject: dg-cmp-results.sh: Do not print usage if either .sum file cannot be opened... * dg-cmp-results.sh: Do not print usage if either .sum file cannot be opened; print a more meaningful error instead. From-SVN: r141979 --- contrib/dg-cmp-results.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'contrib/dg-cmp-results.sh') diff --git a/contrib/dg-cmp-results.sh b/contrib/dg-cmp-results.sh index 753005db204..d291769547d 100755 --- a/contrib/dg-cmp-results.sh +++ b/contrib/dg-cmp-results.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2006 Free Software Foundation +# Copyright (C) 2006, 2008 Free Software Foundation # # Analyze changes in GCC DejaGNU test logs for binutils, gcc, gdb, etc. # Original version written in 2005 by James Lemke . @@ -27,11 +27,21 @@ while test "$1" = "-v"; do shift done -if test $# -ne 3 -o ! -f "$2" -o ! -f "$3"; then +if test $# -ne 3 ; then usage exit 1 fi +if test ! -f "$2"; then + echo "unable to open $2" >&2 + exit 1 +fi + +if test ! -f "$3"; then + echo "unable to open $3" >&2 + exit 1 +fi + # Command differences for various platforms. case `uname -s` in Darwin|NetBSD) -- cgit v1.2.1