From: Andreas Schneider Date: Wed, 10 Jun 2020 15:56:30 +0000 (+0200) Subject: s3:locking: Remove dead code X-Git-Tag: ldb-2.2.0~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de493a3e3b5b8d54f62c45072e27f2fefd4af43a;p=thirdparty%2Fsamba.git s3:locking: Remove dead code Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Isaac Boukris --- diff --git a/source3/locking/posix.c b/source3/locking/posix.c index e2eda225590..6d55b292e00 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -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); } /****************************************************************************