summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-06-20 18:40:32 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-06-20 11:18:35 +0200
commit3a8faefd6625db45e11c775a77413b35189e2ba9 (patch)
tree2297ffd8f2d7511d766604008de88a3c45bfd9db /source3/utils
parent2c71e8596b295e7080eb936db705f452e1d7b9d9 (diff)
downloadsamba-3a8faefd6625db45e11c775a77413b35189e2ba9.tar.gz
samba-3a8faefd6625db45e11c775a77413b35189e2ba9.tar.bz2
samba-3a8faefd6625db45e11c775a77413b35189e2ba9.zip
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 <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_printing.c12
1 files changed, 6 insertions, 6 deletions
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 <file.tdb>\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) {