[SCM] CTDB repository - branch master updated - ctdb-1.13-222-g25d45e6

Amitay Isaacs amitay at samba.org
Thu Jul 26 05:26:12 MDT 2012


The branch, master has been updated
       via  25d45e69f4ffc2b26061ac13038d52a353e79e61 (commit)
      from  624f4677e99ed1710a0ace76201150349b1a0335 (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 25d45e69f4ffc2b26061ac13038d52a353e79e61
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 5 16:27:54 2012 +1000

    statd-callout: Fix a bug in the calculations of $STATE
    
    It is just meant to be even, so divided *and* multiplied by 2.  Use
    $(( )) to make it more readable.
    
    While touching this code, make the related calculation a bit more
    readable too.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 config/statd-callout |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/statd-callout b/config/statd-callout
index 63fee09..0e52cba 100755
--- a/config/statd-callout
+++ b/config/statd-callout
@@ -129,8 +129,7 @@ case "$1" in
 	# We use epoch and hope the nodes are close enough in clock.
 	# Even numbers mean service is shut down, odd numbers mean
 	# service is started.
-	STATE=`date +"%s"`
-	STATE=`expr "$STATE" "/" "2"`
+	STATE=$(( $(date '+%s') / 2 * 2))
 
 
 	# we must also let some time pass between stopping and restarting the
@@ -189,7 +188,7 @@ case "$1" in
 			rm $CTDB_VARDIR/state/statd/ip/$IP/$CLIENT
 			smnotify --client=$CLIENT --ip=$IP --server=$ip --stateval=$STATE
 			smnotify --client=$CLIENT --ip=$IP --server=$NFS_HOSTNAME --stateval=$STATE
-			STATE=`expr "$STATE" "+" "1"`
+			STATE=$(($STATE + 1))
 			smnotify --client=$CLIENT --ip=$IP --server=$ip --stateval=$STATE
 			smnotify --client=$CLIENT --ip=$IP --server=$NFS_HOSTNAME --stateval=$STATE
 		done


-- 
CTDB repository


More information about the samba-cvs mailing list