From: Martin Schwenke Date: Thu, 3 Aug 2017 10:57:47 +0000 (+1000) Subject: ctdb-tests: Move die() function to top of script X-Git-Tag: tdb-1.3.15~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=661426df40abea0960ab3a0f55063dbb009ae6b6;p=thirdparty%2Fsamba.git ctdb-tests: Move die() function to top of script So it can be called within the script instead of just by scripts that include it. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh index 287fb71fd1d..dea0502cbd1 100644 --- a/ctdb/tests/scripts/common.sh +++ b/ctdb/tests/scripts/common.sh @@ -2,6 +2,12 @@ # Common variables and functions for all CTDB tests. +# Print a message and exit. +die () +{ + echo "$1" >&2 ; exit ${2:-1} +} + # This expands the most probable problem cases like "." and "..". TEST_SUBDIR=$(dirname "$0") if [ $(dirname "$TEST_SUBDIR") = "." ] ; then @@ -37,9 +43,3 @@ esac if [ -d "$_test_bin_dir" ] ; then PATH="${_test_bin_dir}:$PATH" fi - -# Print a message and exit. -die () -{ - echo "$1" >&2 ; exit ${2:-1} -}