ctdb-ltdb: Use tdb_null instead of zeroing TDB_DATA variable
authorAmitay Isaacs <amitay@gmail.com>
Mon, 14 Jul 2014 06:30:18 +0000 (16:30 +1000)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Jul 2014 14:01:31 +0000 (16:01 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul 14 16:01:31 CEST 2014 on sn-devel-104

ctdb/common/ctdb_ltdb.c

index 500f7211dfbc00f570ae602daf77790c3c9e8e97..103d89bf2bd889e6c22ea812dc70e940e8e0551d 100644 (file)
@@ -83,7 +83,6 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
 
        rec = tdb_fetch(ctdb_db->ltdb->tdb, key);
        if (rec.dsize < sizeof(*header)) {
-               TDB_DATA d2;
                /* return an initial header */
                if (rec.dptr) free(rec.dptr);
                if (ctdb->vnn_map == NULL) {
@@ -93,12 +92,11 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
                        return -1;
                }
                ltdb_initial_header(ctdb_db, key, header);
-               ZERO_STRUCT(d2);
                if (data) {
-                       *data = d2;
+                       *data = tdb_null;
                }
                if (ctdb_db->persistent || header->dmaster == ctdb_db->ctdb->pnn) {
-                       if (ctdb_ltdb_store(ctdb_db, key, header, d2) != 0) {
+                       if (ctdb_ltdb_store(ctdb_db, key, header, tdb_null) != 0) {
                                DEBUG(DEBUG_NOTICE,
                                      (__location__ "failed to store initial header\n"));
                        }