From 4823262439bc6c1ce9fcce97ed472ad44e85cb77 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:32 +0930 Subject: tdb2: #ifdef out TDB_ERR_NOLOCK and TDB_ERR_LOCK_TIMEOUT. These don't exist in tdb2. The former is used in one weird place in tdb1, and the latter not at all. Signed-off-by: Rusty Russell --- source3/lib/gencache.c | 7 ++++++- source3/lib/util_tdb.c | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index 296f50ebae..c00cc115af 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -463,7 +463,12 @@ bool gencache_stabilize(void) res = tdb_transaction_start_nonblock(cache); if (res != 0) { - if (tdb_error(cache) == TDB_ERR_NOLOCK) { +#if BUILD_TDB2 + if (res == TDB_ERR_LOCK) +#else + if (tdb_error(cache) == TDB_ERR_NOLOCK) +#endif + { /* * Someone else already does the stabilize, * this does not have to be done twice diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index e78dbec704..92c43d8605 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -511,6 +511,7 @@ NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err) result = NT_STATUS_FILE_LOCK_CONFLICT; break; +#ifndef BUILD_TDB2 case TDB_ERR_NOLOCK: case TDB_ERR_LOCK_TIMEOUT: /* @@ -518,6 +519,7 @@ NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err) */ result = NT_STATUS_FILE_LOCK_CONFLICT; break; +#endif case TDB_ERR_NOEXIST: result = NT_STATUS_NOT_FOUND; break; @@ -527,9 +529,11 @@ NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err) case TDB_ERR_RDONLY: result = NT_STATUS_ACCESS_DENIED; break; +#ifndef BUILD_TDB2 case TDB_ERR_NESTING: result = NT_STATUS_INTERNAL_ERROR; break; +#endif }; return result; } -- cgit