]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
if a test fails report original exit code instead of just 1
authorPeter Stamfest <peter@stamfest.at>
Fri, 14 Mar 2014 06:31:00 +0000 (07:31 +0100)
committerPeter Stamfest <peter@stamfest.at>
Fri, 14 Mar 2014 06:31:59 +0000 (07:31 +0100)
tests/functions

index fecb07513adf919427d96f06b3c1241716453dcb..bef671859d83bdc2abc6f4ca2f081e8268e62698 100644 (file)
@@ -23,17 +23,18 @@ fi
 DIFF="diff -u"
 
 function fail {
-       echo >&2 "FAILED: (rc=$?)" "$@"
+       RC=$?
+       echo >&2 "FAILED: (rc=$RC)" "$@"
        if [ -n "$CONTINUE" ] ; then
                return
        fi
        if [ -n "$INTERACTIVE" ] ; then
                read -p "Continue? (y/n)" YN
                if [ "$YN" != 'y' ] ; then 
-                       exit 1
+                       exit $RC
                fi
        else
-               exit 1
+               exit $RC
        fi
 }