diff options
author | Martin Schwenke <martin@meltin.net> | 2016-05-31 18:37:30 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2016-06-08 00:51:28 +0200 |
commit | dbd4e67aee5c0cd880c3692f66c9f2772f0fb672 (patch) | |
tree | 080c04d798042974da24af9c3c1739a6847a6747 /ctdb | |
parent | fdd214ce6a0c25007974b54a9edebfbf73e5cf89 (diff) | |
download | samba-dbd4e67aee5c0cd880c3692f66c9f2772f0fb672.tar.gz |
ctdb-recoverd: Don't expose internal cluster mutex status
Just expose whether the lock was taken.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdb_recoverd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index c0adebec781..adff56cdce5 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -1548,7 +1548,7 @@ static bool ctdb_recovery_have_lock(struct ctdb_context *ctdb) struct hold_reclock_state { bool done; - char status; + bool locked; }; static void hold_reclock_handler(struct ctdb_context *ctdb, @@ -1579,7 +1579,7 @@ static void hold_reclock_handler(struct ctdb_context *ctdb, } s->done = true; - s->status = status; + s->locked = (status == '0') ; } static bool ctdb_recovery_lock(struct ctdb_context *ctdb) @@ -1587,7 +1587,7 @@ static bool ctdb_recovery_lock(struct ctdb_context *ctdb) struct ctdb_cluster_mutex_handle *h; struct hold_reclock_state s = { .done = false, - .status = '0', + .locked = false, }; h = ctdb_cluster_mutex(ctdb, ctdb->recovery_lock, 0); @@ -1604,7 +1604,7 @@ static bool ctdb_recovery_lock(struct ctdb_context *ctdb) /* Ensure no attempts to access to s after function return */ ctdb_cluster_mutex_set_handler(h, hold_reclock_handler, NULL); - return (s.status == '0'); + return s.locked; } static void ctdb_recovery_unlock(struct ctdb_context *ctdb) |