vfs_gpfs: Switch share mode helper function to return int
authorChristof Schmitt <cs@samba.org>
Mon, 6 Jan 2020 21:25:22 +0000 (14:25 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 8 Jan 2020 00:01:37 +0000 (00:01 +0000)
Follow the convention to return 0 on success and -1 when hitting an
error.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_gpfs.c

index 25ec8f158f889e5366ba1f8f41dd534c15c8b680..18ab3be37e84634948bd98b137ec2d301d08bfca 100644 (file)
@@ -114,8 +114,8 @@ static unsigned int vfs_gpfs_share_access_to_deny(uint32_t share_access)
        return deny;
 }
 
-static bool set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
-                              uint32_t share_access)
+static int set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
+                             uint32_t share_access)
 {
        unsigned int allow = GPFS_SHARE_NONE;
        unsigned int deny = GPFS_DENY_NONE;
@@ -136,7 +136,7 @@ static bool set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
                           strerror(errno)));
        }
 
-       return (result == 0);
+       return result;
 }
 
 static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
@@ -168,9 +168,7 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
 
        kernel_flock(fsp->fh->fd, share_access, access_mask);
 
-       if (!set_gpfs_sharemode(fsp, access_mask, share_access)) {
-               ret = -1;
-       }
+       ret = set_gpfs_sharemode(fsp, access_mask, share_access);
 
        END_PROFILE(syscall_kernel_flock);