summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-02-28 00:37:13 +0000
committerTim Potter <tpot@samba.org>2000-02-28 00:37:13 +0000
commit79691801f44612dea731fe9161a1db5eb82fca94 (patch)
treebdd37d01f9bb18a6a9f0ddb17645591741b50938 /source3
parent676df39cc72599b5e3870790ddb6a2eadcdaf5f9 (diff)
downloadsamba-79691801f44612dea731fe9161a1db5eb82fca94.tar.gz
samba-79691801f44612dea731fe9161a1db5eb82fca94.tar.bz2
samba-79691801f44612dea731fe9161a1db5eb82fca94.zip
Modifications to tdb_traverse() arguments to remove compile warnings.
(This used to be commit d64456b5889f0ee3a8c2108c13789540bfc3d90c)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/tdbtool.c8
-rw-r--r--source3/tdb/tdbtorture.c5
2 files changed, 10 insertions, 3 deletions
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index 76b6259ef8..317ad9b4fc 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/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/source3/tdb/tdbtorture.c b/source3/tdb/tdbtorture.c
index d72d7b3525..159b47f369 100644
--- a/source3/tdb/tdbtorture.c
+++ b/source3/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");