diff options
author | Tim Potter <tpot@samba.org> | 2000-02-28 00:37:13 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2000-02-28 00:37:13 +0000 |
commit | d64456b5889f0ee3a8c2108c13789540bfc3d90c (patch) | |
tree | 20af4fa853675f6b5942faa23459ccf74170465f /source/tdb | |
parent | b345c0a1058bcde7689bb9566535e9f1c46ee173 (diff) | |
download | samba-d64456b5889f0ee3a8c2108c13789540bfc3d90c.tar.gz samba-d64456b5889f0ee3a8c2108c13789540bfc3d90c.tar.xz samba-d64456b5889f0ee3a8c2108c13789540bfc3d90c.zip |
Modifications to tdb_traverse() arguments to remove compile warnings.
Diffstat (limited to 'source/tdb')
-rw-r--r-- | source/tdb/tdbtool.c | 8 | ||||
-rw-r--r-- | 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"); |