From b210e7aade5bc6445df22e4cd4b9b906cb40c236 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 28 Jan 2014 11:58:05 +0100 Subject: dbwrap: use DBWRAP_LOCK_ORDER_VALID() in db_open() instead of the hand written test. Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Feb 7 18:05:51 CET 2014 on sn-devel-104 --- source3/lib/dbwrap/dbwrap_open.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source3') diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index ee5ec74983..3c8756b0bc 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -68,15 +68,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, const char *sockname; #endif - switch (lock_order) { - case DBWRAP_LOCK_ORDER_1: - case DBWRAP_LOCK_ORDER_2: - case DBWRAP_LOCK_ORDER_3: - break; - default: - /* - * Only allow the 3 levels ctdb gives us. - */ + if (!DBWRAP_LOCK_ORDER_VALID(lock_order)) { errno = EINVAL; return NULL; } -- cgit