ctdb-client: Server id exists should check if the pid still exists
authorAmitay Isaacs <amitay@gmail.com>
Fri, 4 Aug 2017 04:22:31 +0000 (14:22 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 14 Aug 2017 07:01:21 +0000 (09:01 +0200)
This matches what the older client code and samba does.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/client/client_util.c

index f5d03095189bdef5b49b5426be5d600b463df195..c68135f0af96ef1e6622d1d3ca749ea6e5b30e00 100644 (file)
@@ -117,17 +117,17 @@ int ctdb_server_id_exists(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                          struct ctdb_client_context *client,
                          struct ctdb_server_id *sid, bool *exists)
 {
-       uint8_t *result;
+       int result;
        int ret;
 
-       ret = ctdb_ctrl_check_srvids(mem_ctx, ev, client, sid->vnn,
-                                    tevent_timeval_zero(),
-                                    &sid->unique_id, 1, &result);
+       ret = ctdb_ctrl_process_exists(mem_ctx, ev, client, sid->vnn,
+                                      tevent_timeval_zero(),
+                                      sid->pid, &result);
        if (ret != 0) {
                return ret;
        }
 
-       if (result[0] == 1) {
+       if (result == 1) {
                *exists = true;
        } else {
                *exists = false;