diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-06-04 14:25:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:07 -0500 |
commit | 9bf4687932853873bae1df460762f3d96c5d332f (patch) | |
tree | 93b9cb24c8084bf76bd7f3ff6ebd0b7eb228b57a /source3 | |
parent | 9d71e20363fba93dd83f9e5906d6776acc1ede55 (diff) | |
download | samba-9bf4687932853873bae1df460762f3d96c5d332f.tar.gz samba-9bf4687932853873bae1df460762f3d96c5d332f.tar.bz2 samba-9bf4687932853873bae1df460762f3d96c5d332f.zip |
r23337: fix a crash bug...I wonder why only HP-UX 11.00 ans 11.11 noticed
it via a SIGBUS...
I missed to remove the samba3 specifc code path to tdb_open_ex()
when I synced lib/tdb/ with samba4. The explicit cast in on tdb_open_ex()
dropped the compiler warning :-(
metze
(This used to be commit 815d2101715d6646fc15ac9f2853cf727cf7fcd8)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c index 4f3acad9ea..03c9ae85b2 100644 --- a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c +++ b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c @@ -58,22 +58,6 @@ static int ltdb_wrap_destructor(struct ltdb_wrap *w) return 0; } -#if defined(_SAMBA_BUILD_) && (_SAMBA_BUILD_ <= 3) -static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4); -static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) -{ - /* until we merge the tdb debug changes into samba3, we don't know - how serious the error is, and we can't go via the ldb loggin code */ - va_list ap; - const char *name = tdb_name(tdb); - char *message; - va_start(ap, fmt); - message = talloc_vasprintf(NULL, fmt, ap); - va_end(ap); - DEBUG(3, ("ltdb: tdb(%s): %s", name, message)); - talloc_free(message); -} -#else static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4); static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) { @@ -106,7 +90,6 @@ static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, con ldb_debug(ldb, ldb_level, "ltdb: tdb(%s): %s", name, message); talloc_free(message); } -#endif /* wrapped connection to a tdb database. The caller should _not_ free @@ -122,14 +105,10 @@ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx, { struct ltdb_wrap *w; struct stat st; -#if defined(_SAMBA_BUILD_) && (_SAMBA_BUILD_ <= 3) - tdb_log_func log_ctx_p = ltdb_log_fn; -#else struct tdb_logging_context log_ctx; - const struct tdb_logging_context *log_ctx_p = &log_ctx; + log_ctx.log_fn = ltdb_log_fn; log_ctx.log_private = ldb; -#endif if (stat(path, &st) == 0) { for (w=tdb_list;w;w=w->next) { @@ -147,9 +126,7 @@ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx, return NULL; } - w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode, - (const struct tdb_logging_context *)log_ctx_p, - NULL); + w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode, &log_ctx, NULL); if (w->tdb == NULL) { talloc_free(w); return NULL; |