1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Modifications to tdb_traverse() arguments to remove compile warnings.

This commit is contained in:
Tim Potter 0001-01-01 00:00:00 +00:00
parent b345c0a105
commit d64456b588
2 changed files with 10 additions and 3 deletions

View File

@ -170,6 +170,12 @@ static char *getline(char *prompt)
return p?line:NULL; 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[]) int main(int argc, char *argv[])
{ {
char *line; char *line;
@ -199,7 +205,7 @@ int main(int argc, char *argv[])
} else if (strcmp(tok,"show") == 0) { } else if (strcmp(tok,"show") == 0) {
show_tdb(); show_tdb();
} else if (strcmp(tok,"erase") == 0) { } 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) { } else if (strcmp(tok,"delete") == 0) {
delete_tdb(); delete_tdb();
} else if (strcmp(tok,"dump") == 0) { } else if (strcmp(tok,"dump") == 0) {

View File

@ -74,7 +74,8 @@ static void addrec_db(void)
free(d); 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); tdb_delete(db, key);
return 0; return 0;
@ -97,7 +98,7 @@ int main(int argc, char *argv[])
if (fork() == 0) break; 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); O_RDWR | O_CREAT, 0600);
if (!db) { if (!db) {
fatal("db open failed"); fatal("db open failed");