summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap/dbwrap_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_open.c')
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 9bf279b1d82..5491a1f56bd 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;