From: Rusty Russell Date: Sun, 29 Jan 2012 22:55:50 +0000 (+1030) Subject: ldb_wrap.c: fix TDB2-incompatible API usage. X-Git-Tag: tevent-0.9.15~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae62d46a9fcfee9db177ddb3d0f1f2c28c889a35;p=thirdparty%2Fsamba.git ldb_wrap.c: fix TDB2-incompatible API usage. Auditing revealed one place still expecting a -1 return on failure: tdb2 returns the (negative) errcode directly, so the portable way to do this is to check for != 0. Signed-off-by: Rusty Russell --- diff --git a/lib/ldb-samba/ldb_wrap.c b/lib/ldb-samba/ldb_wrap.c index 66213bf2881..b8af8c151f8 100644 --- a/lib/ldb-samba/ldb_wrap.c +++ b/lib/ldb-samba/ldb_wrap.c @@ -332,7 +332,7 @@ int samba_ldb_connect(struct ldb_context *ldb, struct loadparm_context *lp_ctx, } } - if (tdb_reopen_all(1) == -1) { + if (tdb_reopen_all(1) != 0) { smb_panic("tdb_reopen_all failed\n"); } }