svn commit: samba r23339 - in
branches/SAMBA_4_0/source/lib/ldb/ldb_tdb: .
metze at samba.org
metze at samba.org
Mon Jun 4 14:26:38 GMT 2007
Author: metze
Date: 2007-06-04 14:26:37 +0000 (Mon, 04 Jun 2007)
New Revision: 23339
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23339
Log:
merge from SAMBA_3_0:
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
Modified:
branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c 2007-06-04 14:26:07 UTC (rev 23338)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c 2007-06-04 14:26:37 UTC (rev 23339)
@@ -57,22 +57,6 @@
return 0;
}
-#if defined(_SAMBA_BUILD_) && (_SAMBA_BUILD_ <= 3)
-static void ltdb_log_fn(struct tdb_context *tdb, int level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4);
-static void ltdb_log_fn(struct tdb_context *tdb, int 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, ...)
{
@@ -105,7 +89,6 @@
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
@@ -121,14 +104,10 @@
{
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) {
@@ -146,7 +125,7 @@
return NULL;
}
- w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode, 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;
More information about the samba-cvs
mailing list