From 8bab4bdc5dc73f460034d366495705c68eef5347 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 20 Aug 2007 07:59:22 +0000 Subject: [PATCH] r24571: Only look at errno if the close call actually failed Patch from Ofir Azoulay -- thanks (This used to be commit 888e657d758173c0eb4b68059d6fb5ae45b2b2ed) --- source3/locking/posix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 606f2086732..f7d70504b1b 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -640,7 +640,10 @@ NTSTATUS fd_close_posix(struct connection_struct *conn, files_struct *fsp) */ ret = SMB_VFS_CLOSE(fsp,fsp->fh->fd); fsp->fh->fd = -1; - return map_nt_error_from_unix(errno); + if (ret == -1) { + return map_nt_error_from_unix(errno); + } + return NT_STATUS_OK; } if (get_windows_lock_ref_count(fsp)) {