s3:locking: Remove dead code
authorAndreas Schneider <asn@samba.org>
Wed, 10 Jun 2020 15:56:30 +0000 (17:56 +0200)
committerIsaac Boukris <iboukris@sn-devel-184>
Tue, 16 Jun 2020 09:08:34 +0000 (09:08 +0000)
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
source3/locking/posix.c

index e2eda225590b43863dcf376677e93e0a0b900b5f..6d55b292e00cdd464f8d37a4eb475ccd2ff46faf 100644 (file)
@@ -581,8 +581,6 @@ static void fd_close_posix_fn(
 
 int fd_close_posix(const struct files_struct *fsp)
 {
-       int saved_errno = 0;
-       int ret;
        NTSTATUS status;
 
        if (!lp_locking(fsp->conn->params) ||
@@ -627,14 +625,7 @@ int fd_close_posix(const struct files_struct *fsp)
         * Finally close the fd associated with this fsp.
         */
 
-       ret = close(fsp->fh->fd);
-
-       if (ret == 0 && saved_errno != 0) {
-               errno = saved_errno;
-               ret = -1;
-       }
-
-       return ret;
+       return close(fsp->fh->fd);
 }
 
 /****************************************************************************