From 5638565f6a0a56c60a729b89311482b1b34e9cdc Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 20 May 2019 22:18:59 +0200 Subject: [PATCH] Refactored locking handling --- dev/n_osync.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/dev/n_osync.sh b/dev/n_osync.sh index 70f6bc0..67c3996 100644 --- a/dev/n_osync.sh +++ b/dev/n_osync.sh @@ -7,7 +7,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2019 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=1.3.0-beta2 -PROGRAM_BUILD=2019052012 +PROGRAM_BUILD=2019052013 IS_STABLE=false CONFIG_FILE_REVISION_REQUIRED=1.3.0 @@ -649,24 +649,20 @@ function HandleLocks { targetLockSuccess=false fi done - - #WIP refactor the following - if [ $initiatorLockSuccess == true ]; then - INITIATOR_LOCK_FILE_EXISTS=true - fi - if [ $targetLockSuccess == true ]; then - TARGET_LOCK_FILE_EXISTS=true - fi - Logger "Cancelling task." "CRITICAL" $retval - exit 1 fi + if [ $initiatorLockSuccess == true ]; then INITIATOR_LOCK_FILE_EXISTS=true fi if [ $targetLockSuccess == true ]; then TARGET_LOCK_FILE_EXISTS=true fi + + if [ $retval -ne 0 ]; then + Logger "Cancelling task." "CRITICAL" $retval + exit 1 + fi } function _UnlockReplicasLocal {