diff options
Diffstat (limited to 'source4/lib/tdb_helper.c')
-rw-r--r-- | source4/lib/tdb_helper.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/source4/lib/tdb_helper.c b/source4/lib/tdb_helper.c index 2698e3cc71..e29a8a7211 100644 --- a/source4/lib/tdb_helper.c +++ b/source4/lib/tdb_helper.c @@ -25,45 +25,3 @@ dealing with a tdb database a little less cumbersome in Samba */ -/**************************************************************************** - Log tdb messages via DEBUG(). -****************************************************************************/ - -static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); - -static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) -{ - va_list ap; - char *ptr = NULL; - - va_start(ap, format); - vasprintf(&ptr, format, ap); - va_end(ap); - - if (!ptr || !*ptr) - return; - - DEBUG(level, ("tdb(%s): %s", tdb->name ? tdb->name : "unnamed", ptr)); - SAFE_FREE(ptr); -} - -/**************************************************************************** - Like tdb_open() but also setup a logging function that redirects to - the samba DEBUG() system. -****************************************************************************/ - -TDB_CONTEXT *tdb_open_log(const char *name, int hash_size, int tdb_flags, - int open_flags, mode_t mode) -{ - TDB_CONTEXT *tdb; - - if (!lp_use_mmap()) - tdb_flags |= TDB_NOMMAP; - - tdb = tdb_open_ex(name, hash_size, tdb_flags, - open_flags, mode, tdb_log, NULL); - if (!tdb) - return NULL; - - return tdb; -} |