From: Christof Schmitt Date: Mon, 6 Jan 2020 21:25:22 +0000 (-0700) Subject: vfs_gpfs: Switch share mode helper function to return int X-Git-Tag: ldb-2.1.0~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03705f4c2fbac6534a925d7511749d4daa378b2e;p=thirdparty%2Fsamba.git vfs_gpfs: Switch share mode helper function to return int Follow the convention to return 0 on success and -1 when hitting an error. Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 25ec8f158f8..18ab3be37e8 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -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);