summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c11
-rw-r--r--source3/lib/dbwrap/dbwrap_open.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 9bf279b1d8..5491a1f56b 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -66,11 +66,14 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
const char *sockname;
#endif
- if ((lock_order != DBWRAP_LOCK_ORDER_1) &&
- (lock_order != DBWRAP_LOCK_ORDER_2)) {
+ switch (lock_order) {
+ case DBWRAP_LOCK_ORDER_1:
+ case DBWRAP_LOCK_ORDER_2:
+ case DBWRAP_LOCK_ORDER_3:
+ break;
+ default:
/*
- * Only allow 2 levels. ctdb gives us 3, and we will
- * have the watchers database soon.
+ * Only allow the 3 levels ctdb gives us.
*/
errno = EINVAL;
return NULL;
diff --git a/source3/lib/dbwrap/dbwrap_open.h b/source3/lib/dbwrap/dbwrap_open.h
index 2763ef2ade..9ed2245afd 100644
--- a/source3/lib/dbwrap/dbwrap_open.h
+++ b/source3/lib/dbwrap/dbwrap_open.h
@@ -31,7 +31,8 @@ bool db_is_local(const char *name);
enum dbwrap_lock_order {
DBWRAP_LOCK_ORDER_1 = 1,
- DBWRAP_LOCK_ORDER_2 = 2
+ DBWRAP_LOCK_ORDER_2 = 2,
+ DBWRAP_LOCK_ORDER_3 = 3
};
/**