lib: Use ctdbd_control_unix in ctdbd_db_attach
authorVolker Lendecke <vl@samba.org>
Sat, 3 Oct 2015 03:08:53 +0000 (20:08 -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 7bb1e35aede24923ca9a490aee0eb5064c007469..525aab74b82ad15f903e05e5a3deef9dfca3cdea 100644 (file)
@@ -1087,7 +1087,7 @@ NTSTATUS ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
 {
        struct ctdbd_connection *conn;
        NTSTATUS status;
-
+       int ret;
        TDB_DATA key, data;
        struct ctdb_traverse_start t;
        int cstatus;
@@ -1109,13 +1109,14 @@ NTSTATUS ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
        data.dptr = (uint8_t *)&t;
        data.dsize = sizeof(t);
 
-       status = ctdbd_control(conn, CTDB_CURRENT_NODE,
-                              CTDB_CONTROL_TRAVERSE_START, conn->rand_srvid, 0,
-                              data, NULL, NULL, &cstatus);
+       ret = ctdbd_control_unix(conn, CTDB_CURRENT_NODE,
+                                CTDB_CONTROL_TRAVERSE_START, conn->rand_srvid,
+                                0, data, NULL, NULL, &cstatus);
 
-       if (!NT_STATUS_IS_OK(status) || (cstatus != 0)) {
+       if ((ret != 0) || (cstatus != 0)) {
+               status = map_nt_error_from_unix(ret);
 
-               DEBUG(0,("ctdbd_control failed: %s, %d\n", nt_errstr(status),
+               DEBUG(0,("ctdbd_control failed: %s, %d\n", strerror(ret),
                         cstatus));
 
                if (NT_STATUS_IS_OK(status)) {
@@ -1132,7 +1133,6 @@ NTSTATUS ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
                struct ctdb_req_header *hdr = NULL;
                struct ctdb_req_message *m;
                struct ctdb_rec_data *d;
-               int ret;
 
                ret = ctdb_read_packet(conn->fd, conn->timeout, conn, &hdr);
                if (ret != 0) {