From: Volker Lendecke Date: Mon, 30 Nov 2009 23:01:36 +0000 (+0100) Subject: s3: Cope with older external libtdb X-Git-Tag: samba-4.0.0alpha10~143 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53744f01dc7f74f87e4c71057cc175e4c47d3a67;p=thirdparty%2Fsamba.git s3: Cope with older external libtdb --- diff --git a/source3/configure.in b/source3/configure.in index 9317685fc3c..de30f143a9d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2006,6 +2006,16 @@ then AC_SUBST(TDBTOOL) TDBTORTURE="bin/tdbtorture\$(EXEEXT)" AC_SUBST(TDBTORTURE) + ac_cv_have_tdb_err_nesting=yes +else + AC_TRY_COMPILE([#include "tdb.h"], + [enum TDB_ERROR err = TDB_ERR_NESTING], + ac_cv_have_tdb_err_nesting=yes, + ac_cv_have_tdb_err_nesting=no) +fi + +if test x"$ac_cv_have_tdb_err_nesting" = xyes; then + AC_DEFINE(HAVE_TDB_ERR_NESTING, 1, [Whether we have TDB_ERR_NESTING]) fi SMB_LIBRARY(netapi, 0) diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb.c b/source3/lib/ldb/ldb_tdb/ldb_tdb.c index 6bebb6df1c3..e3bc069d9dd 100644 --- a/source3/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source3/lib/ldb/ldb_tdb/ldb_tdb.c @@ -59,7 +59,9 @@ static int ltdb_err_map(enum TDB_ERROR tdb_code) case TDB_ERR_CORRUPT: case TDB_ERR_OOM: case TDB_ERR_EINVAL: +#if HAVE_TDB_ERR_NESTING case TDB_ERR_NESTING: +#endif return LDB_ERR_OPERATIONS_ERROR; case TDB_ERR_IO: return LDB_ERR_PROTOCOL_ERROR;