vfs_catia: Fix return value in lock functions
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Thu, 16 May 2019 19:21:11 +0000 (21:21 +0200)
committerJeremy Allison <jra@samba.org>
Sun, 19 May 2019 17:34:21 +0000 (17:34 +0000)
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 <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_catia.c

index c362be764cc5bc41be30957b94a38a6b63e9e037..5915e40ff28bc155af71d63328a78a4a8c77f2d9 100644 (file)
@@ -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);