summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-22 23:25:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:19:15 -0500
commit0b5e01c19b4c81fd08cfb2ef9410c03f5522d0ab (patch)
tree5b478c23db7537c0b51aa3f926f331a684433dde /source4/lib
parent58619eebc10cf3e1828f8ecad1362d98ca4e9845 (diff)
downloadsamba-0b5e01c19b4c81fd08cfb2ef9410c03f5522d0ab.tar.gz
samba-0b5e01c19b4c81fd08cfb2ef9410c03f5522d0ab.tar.bz2
samba-0b5e01c19b4c81fd08cfb2ef9410c03f5522d0ab.zip
r18832: fixed standalone build
(This used to be commit 1ebc098b6776d38451e441280ac13664d64569f4)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index 7f81949fdc..654afea2f1 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -58,7 +58,22 @@ static int ltdb_wrap_destructor(struct ltdb_wrap *w)
return 0;
}
-#if (_SAMBA_BUILD_ >= 4)
+#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, ...)
{
@@ -91,21 +106,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);
}
-#else
-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);
-}
#endif
/*
@@ -122,13 +122,13 @@ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx,
{
struct ltdb_wrap *w;
struct stat st;
-#if (_SAMBA_BUILD_ >= 4)
+#if (_SAMBA_BUILD_ <= 3)
+ tdb_log_func log_ctx_p = ltdb_log_fn;
+#else
struct tdb_logging_context log_ctx;
struct tdb_logging_context log_ctx_p = &log_ctx;
log_ctx.log_fn = ltdb_log_fn;
log_ctx.log_private = ldb;
-#else
- tdb_log_func log_ctx_p = ltdb_log_fn;
#endif
if (stat(path, &st) == 0) {