X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Fsummary.c;h=e9f986e7727a4775928617256ed65e11e0dbaa5c;hb=7f63d84eb712c54c57c3d4e9a92ffefe2f1b2ade;hp=e7a291967cb034cda442b807ed563fc8c7c2b58e;hpb=46d8f62015fb8bf6fe173573a55ea3f6324cee0a;p=ccan diff --git a/ccan/tdb2/summary.c b/ccan/tdb2/summary.c index e7a29196..e9f986e7 100644 --- a/ccan/tdb2/summary.c +++ b/ccan/tdb2/summary.c @@ -163,6 +163,8 @@ char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags) *bucketsg[BUCKETS_FOR_ZONE(63)+1] = { NULL }; char *ret = NULL; + zonesg = hashesg = freeg = keysg = datag = extrag = uncoalg = NULL; + if (tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false) != 0) return NULL; @@ -222,9 +224,6 @@ char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags) HISTO_WIDTH, HISTO_HEIGHT); } - } else { - zonesg = hashesg = freeg = keysg = datag = extrag = uncoalg - = NULL; } /* 20 is max length of a %llu. */