]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Avoid shellcheck warning SC2017 (arithmetic precision)
authorMartin Schwenke <martin@meltin.net>
Wed, 6 Jul 2016 10:14:03 +0000 (20:14 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 21 Jul 2016 00:24:26 +0000 (02:24 +0200)
SC2017: Increase precision by replacing a/b*c with a*c/b.

This code intentionally rounds to an even value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/statd-callout

index 74402107ffd9396029fb5120401afede6854fc99..ce7d63997d3095a792319e303eef3583d91b0bdb 100755 (executable)
@@ -119,6 +119,8 @@ 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.
+       # Intentionally round to an even number
+       # shellcheck disable=SC2017
        state_even=$(( $(date '+%s') / 2 * 2))
 
        # We must also let some time pass between stopping and