ldb_wrap.c: fix TDB2-incompatible API usage.
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 29 Jan 2012 22:55:50 +0000 (09:25 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 29 Jan 2012 22:55:50 +0000 (09:25 +1030)
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 <rusty@rustcorp.com.au>
lib/ldb-samba/ldb_wrap.c

index 66213bf2881256dd3eaeaa458b557f3916b51f8a..b8af8c151f84d103e87a50d8ea75de01208299bf 100644 (file)
@@ -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");
        }
 }