From 868d77bc5b38e628f74d5cd03c5f87eb5a666b09 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:31 +0930 Subject: tdb_chainlock: check returns for 0, not -1. TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell --- source3/libsmb/smb_share_modes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/smb_share_modes.c') diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index e891b960d8..86e1a81ef1 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -122,7 +122,7 @@ int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx, { struct locking_key lk; return tdb_chainlock(db_ctx->smb_tdb, get_locking_key(&lk, dev, ino, - extid)); + extid)) == 0 ? 0 : -1; } int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx, -- cgit