vfs_gpfs: Use early return in sharemode function
authorChristof Schmitt <cs@samba.org>
Mon, 6 Jan 2020 21:40:07 +0000 (14:40 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 8 Jan 2020 00:01:37 +0000 (00:01 +0000)
This removes one level of indentation.

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

index 18ab3be37e84634948bd98b137ec2d301d08bfca..632c8ad044d6186abe84c6fdb6e633055f00241a 100644 (file)
@@ -131,11 +131,12 @@ static int set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
                  "deny=0x%x\n", access_mask, allow, share_access, deny);
 
        result = gpfswrap_set_share(fsp->fh->fd, allow, deny);
-       if (result != 0) {
-               DEBUG(10, ("gpfs_set_share failed: %s\n",
-                          strerror(errno)));
+       if (result == 0) {
+               return 0;
        }
 
+       DEBUG(10, ("gpfs_set_share failed: %s\n", strerror(errno)));
+
        return result;
 }