From: Rikard Falkeborn Date: Thu, 16 May 2019 19:21:11 +0000 (+0200) Subject: vfs_catia: Fix return value in lock functions X-Git-Tag: ldb-2.0.5~766 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18965c0b84847aa0479a2b371339c309ac5d64a2;p=thirdparty%2Fsamba.git vfs_catia: Fix return value in lock functions Returning -1 in a function with bool as return value type is the same as returning true. Change to false to indicate the error. Detected by the help of cppcheck. Signed-off-by: Rikard Falkeborn Reviewed-by: Ralph Böhme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index c362be764cc..5915e40ff28 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -2116,7 +2116,7 @@ static bool catia_lock(vfs_handle_struct *handle, ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc); if (ret != 0) { - return -1; + return false; } ok = SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type); @@ -2178,7 +2178,7 @@ static bool catia_getlock(vfs_handle_struct *handle, ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc); if (ret != 0) { - return -1; + return false; } ok = SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid); @@ -2198,7 +2198,7 @@ static bool catia_strict_lock_check(struct vfs_handle_struct *handle, ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc); if (ret != 0) { - return -1; + return false; } ok = SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);