libctdb: fix wrong argument being handed to callback on attachdb fail
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 4 Jun 2010 04:04:06 +0000 (13:34 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 4 Jun 2010 04:04:06 +0000 (13:34 +0930)
When attachdb failed, we were handing the db, not the user-supplied
arg to the callback.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
libctdb/ctdb.c

index 8700a60dd4d207671c51431d44c3e1d7c7b15980..43c2829c5724038a95a4ab43ab62f1cf447fc025 100644 (file)
@@ -449,7 +449,7 @@ static void attachdb_done(struct ctdb_connection *ctdb,
        if (!reply || reply->status != 0) {
                /* We failed.  Hand request to user and have them discover it
                 * via ctdb_attachdb_recv. */
-               db->callback(ctdb, req, db);
+               db->callback(ctdb, req, db->private_data);
                return;
        }
        db->id = *(uint32_t *)reply->data;
@@ -460,7 +460,7 @@ static void attachdb_done(struct ctdb_connection *ctdb,
                                        &db->id, sizeof(db->id),
                                        attachdb_getdbpath_done, db);
        if (!req2) {
-               db->callback(ctdb, req, db);
+               db->callback(ctdb, req, db->private_data);
                return;
        }
        req->extra = req2;