]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Move die() function to top of script
authorMartin Schwenke <martin@meltin.net>
Thu, 3 Aug 2017 10:57:47 +0000 (20:57 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 14 Aug 2017 03:15:25 +0000 (05:15 +0200)
So it can be called within the script instead of just by scripts that
include it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/scripts/common.sh

index 287fb71fd1d76e259e123d6a58117f4931691234..dea0502cbd1509af6dcaa9e426bd4d14bb0e9720 100644 (file)
@@ -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}
-}