From 3a8faefd6625db45e11c775a77413b35189e2ba9 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:32 +0930 Subject: tdb_compat: use tdb_firstkey_compat/tdb_nextkey_compat everywhere. Note that tdb_nextkey_compat frees the old key for us. Signed-off-by: Rusty Russell --- source3/utils/net_printing.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_printing.c b/source3/utils/net_printing.c index bfab0dc995..2f8caad8fd 100644 --- a/source3/utils/net_printing.c +++ b/source3/utils/net_printing.c @@ -162,7 +162,7 @@ static int net_printing_dump(struct net_context *c, int argc, int ret = -1; TALLOC_CTX *ctx = talloc_stackframe(); TDB_CONTEXT *tdb; - TDB_DATA kbuf, newkey, dbuf; + TDB_DATA kbuf, dbuf; if (argc < 1 || c->display_usage) { d_fprintf(stderr, "%s\nnet printing dump \n", @@ -176,9 +176,9 @@ static int net_printing_dump(struct net_context *c, int argc, goto done; } - for (kbuf = tdb_firstkey(tdb); + for (kbuf = tdb_firstkey_compat(tdb); kbuf.dptr; - newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf=newkey) + kbuf = tdb_nextkey_compat(tdb, kbuf)) { dbuf = tdb_fetch_compat(tdb, kbuf); if (!dbuf.dptr) { @@ -637,7 +637,7 @@ static NTSTATUS printing_migrate_internal(struct net_context *c, { TALLOC_CTX *tmp_ctx; TDB_CONTEXT *tdb; - TDB_DATA kbuf, newkey, dbuf; + TDB_DATA kbuf, dbuf; NTSTATUS status; tmp_ctx = talloc_new(mem_ctx); @@ -652,9 +652,9 @@ static NTSTATUS printing_migrate_internal(struct net_context *c, goto done; } - for (kbuf = tdb_firstkey(tdb); + for (kbuf = tdb_firstkey_compat(tdb); kbuf.dptr; - newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf = newkey) + kbuf = tdb_nextkey_compat(tdb, kbuf)) { dbuf = tdb_fetch_compat(tdb, kbuf); if (!dbuf.dptr) { -- cgit