From ba8f19c556724aaa2de71473234f8bab1f301a7f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 18 Mar 2012 14:47:37 +0100 Subject: s3: Open up 3 levels of dbwrap_lock_order --- source3/lib/dbwrap/dbwrap_open.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/lib/dbwrap/dbwrap_open.c') 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; -- cgit