BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb_counter_get () {
_ctdb_counter_common "$1"
# unary counting!
- stat -c "%s" "$_counter_file" 2>/dev/null || echo 0
+ _val=$(wc -c < "$_counter_file" 2>/dev/null || echo 0)
+ # Strip leading spaces from ouput of wc (on freebsd)
+ # shellcheck disable=SC2086
+ echo $_val
}
########################################################