s3: Cope with older external libtdb
authorVolker Lendecke <vl@samba.org>
Mon, 30 Nov 2009 23:01:36 +0000 (00:01 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 1 Dec 2009 23:38:03 +0000 (00:38 +0100)
source3/configure.in
source3/lib/ldb/ldb_tdb/ldb_tdb.c

index 9317685fc3cbdfbf5227b2b004d5dab93b033c85..de30f143a9d2719abf4e6d8840e489236dce2d65 100644 (file)
@@ -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)
index 6bebb6df1c337b75536bacba275f500af1a8301c..e3bc069d9dda7fdac312452f477794e83807a1c4 100644 (file)
@@ -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;