summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-01-28 11:58:05 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-07 18:05:51 +0100
commitb210e7aade5bc6445df22e4cd4b9b906cb40c236 (patch)
tree9b187a44a1e2555746cd24c3fad2a37026866703 /source3
parentc7961ee4953dbcc8c45790d3c92fe3172e924f47 (diff)
downloadsamba-b210e7aade5bc6445df22e4cd4b9b906cb40c236.tar.gz
samba-b210e7aade5bc6445df22e4cd4b9b906cb40c236.tar.xz
samba-b210e7aade5bc6445df22e4cd4b9b906cb40c236.zip
dbwrap: use DBWRAP_LOCK_ORDER_VALID() in db_open()
instead of the hand written test. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Feb 7 18:05:51 CET 2014 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c10
1 files changed, 1 insertions, 9 deletions
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;
}