diff options
author | Michael Adam <obnox@samba.org> | 2008-03-25 14:18:08 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-03-27 08:38:25 +0100 |
commit | 26df11aca3fb448694dcd58cb0b74eae48f4e470 (patch) | |
tree | 95cd3a70cad0e249d7d1a39bb4baebd0dc53b66f /source/lib | |
parent | 8381866d0789343c4dc88b84ba1e9c70ca69595b (diff) | |
download | samba-26df11aca3fb448694dcd58cb0b74eae48f4e470.tar.gz |
util_tdb: add a wrapper tdb_wipe() for traverse with tdb_traverse_delete_fn().
Replace all callers of traverse with this tdb_traverse_delete_fn() and
don't export tdb_traverse_delete_fn() anymore.
Michael
(cherry picked from commit d4be4e30cd8c3bdc303da30e42280f892a45a8c9)
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/sharesec.c | 2 | ||||
-rw-r--r-- | source/lib/util_tdb.c | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/source/lib/sharesec.c b/source/lib/sharesec.c index f6ff701d5b7..60f6e5077b8 100644 --- a/source/lib/sharesec.c +++ b/source/lib/sharesec.c @@ -65,7 +65,7 @@ static bool share_info_db_init(void) } if (vers_id != SHARE_DATABASE_VERSION_V2) { - tdb_traverse(share_tdb, tdb_traverse_delete_fn, NULL); + tdb_wipe(share_tdb); tdb_store_int32(share_tdb, vstring, SHARE_DATABASE_VERSION_V2); } tdb_unlock_bystring(share_tdb, vstring); diff --git a/source/lib/util_tdb.c b/source/lib/util_tdb.c index 4ecb4d5b819..4332a7948f5 100644 --- a/source/lib/util_tdb.c +++ b/source/lib/util_tdb.c @@ -722,12 +722,18 @@ TDB_CONTEXT *tdb_open_log(const char *name, int hash_size, int tdb_flags, Allow tdb_delete to be used as a tdb_traversal_fn. ****************************************************************************/ -int tdb_traverse_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, - void *state) +static int tdb_traverse_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, + TDB_DATA dbuf, void *state) { return tdb_delete(the_tdb, key); } +int tdb_wipe(TDB_CONTEXT *tdb) +{ + return tdb_traverse(tdb, tdb_traverse_delete_fn, NULL); +} + + /** |