From d64456b5889f0ee3a8c2108c13789540bfc3d90c Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 28 Feb 2000 00:37:13 +0000 Subject: [PATCH] Modifications to tdb_traverse() arguments to remove compile warnings. --- source/tdb/tdbtool.c | 8 +++++++- source/tdb/tdbtorture.c | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source/tdb/tdbtool.c b/source/tdb/tdbtool.c index 76b6259ef8f..317ad9b4fc5 100644 --- a/source/tdb/tdbtool.c +++ b/source/tdb/tdbtool.c @@ -170,6 +170,12 @@ static char *getline(char *prompt) return p?line:NULL; } +static int do_delete_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, + void *state) +{ + return tdb_delete(tdb, key); +} + int main(int argc, char *argv[]) { char *line; @@ -199,7 +205,7 @@ int main(int argc, char *argv[]) } else if (strcmp(tok,"show") == 0) { show_tdb(); } else if (strcmp(tok,"erase") == 0) { - tdb_traverse(tdb, tdb_delete, NULL); + tdb_traverse(tdb, do_delete_fn, NULL); } else if (strcmp(tok,"delete") == 0) { delete_tdb(); } else if (strcmp(tok,"dump") == 0) { diff --git a/source/tdb/tdbtorture.c b/source/tdb/tdbtorture.c index d72d7b35255..159b47f3695 100644 --- a/source/tdb/tdbtorture.c +++ b/source/tdb/tdbtorture.c @@ -74,7 +74,8 @@ static void addrec_db(void) free(d); } -static int traverse_fn(TDB_CONTEXT *db, TDB_DATA key, TDB_DATA dbuf) +static int traverse_fn(TDB_CONTEXT *db, TDB_DATA key, TDB_DATA dbuf, + void *state) { tdb_delete(db, key); return 0; @@ -97,7 +98,7 @@ int main(int argc, char *argv[]) if (fork() == 0) break; } - db = tdb_open("test.tdb", 0, TDB_CLEAR_IF_FIRST, + db = tdb_open(NULL, 0, TDB_CLEAR_IF_FIRST, O_RDWR | O_CREAT, 0600); if (!db) { fatal("db open failed");