lib: Make get_cluster_vnn return 0/errno
authorVolker Lendecke <vl@samba.org>
Sat, 3 Oct 2015 03:42:05 +0000 (20:42 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 7 Oct 2015 21:54:05 +0000 (23:54 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/ctdbd_conn.c

index 347606c4aff0c6572b64af1ce8442e345f5d29d1..30c09364fd81c7d36f75519d11d08022a8b468fc 100644 (file)
@@ -177,7 +177,7 @@ static int ctdbd_msg_call_back(struct ctdbd_connection *conn,
 /*
  * get our vnn from the cluster
  */
-static NTSTATUS get_cluster_vnn(struct ctdbd_connection *conn, uint32_t *vnn)
+static int get_cluster_vnn(struct ctdbd_connection *conn, uint32_t *vnn)
 {
        int32_t cstatus=-1;
        int ret;
@@ -186,10 +186,10 @@ static NTSTATUS get_cluster_vnn(struct ctdbd_connection *conn, uint32_t *vnn)
                            tdb_null, NULL, NULL, &cstatus);
        if (ret != 0) {
                DEBUG(1, ("ctdbd_control failed: %s\n", strerror(ret)));
-               return map_nt_error_from_unix(ret);
+               return ret;
        }
        *vnn = (uint32_t)cstatus;
-       return NT_STATUS_OK;
+       return ret;
 }
 
 /*
@@ -451,10 +451,11 @@ static NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx,
        }
        talloc_set_destructor(conn, ctdbd_connection_destructor);
 
-       status = get_cluster_vnn(conn, &conn->our_vnn);
+       ret = get_cluster_vnn(conn, &conn->our_vnn);
 
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(10, ("get_cluster_vnn failed: %s\n", nt_errstr(status)));
+       if (ret != 0) {
+               DEBUG(10, ("get_cluster_vnn failed: %s\n", strerror(ret)));
+               status = map_nt_error_from_unix(ret);
                goto fail;
        }