Author: vlendec
Date: 2007-08-20 07:59:22 +0000 (Mon, 20 Aug 2007)
New Revision: 24571

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24571

Log:
Only look at errno if the close call actually failed

Patch from Ofir Azoulay <[EMAIL PROTECTED]> -- thanks

Modified:
   branches/SAMBA_3_0_25/source/locking/posix.c
   branches/SAMBA_3_2/source/locking/posix.c
   branches/SAMBA_3_2_0/source/locking/posix.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/locking/posix.c
===================================================================
--- branches/SAMBA_3_0_25/source/locking/posix.c        2007-08-20 07:30:59 UTC 
(rev 24570)
+++ branches/SAMBA_3_0_25/source/locking/posix.c        2007-08-20 07:59:22 UTC 
(rev 24571)
@@ -651,7 +651,10 @@
                 */
                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)) {

Modified: branches/SAMBA_3_2/source/locking/posix.c
===================================================================
--- branches/SAMBA_3_2/source/locking/posix.c   2007-08-20 07:30:59 UTC (rev 
24570)
+++ branches/SAMBA_3_2/source/locking/posix.c   2007-08-20 07:59:22 UTC (rev 
24571)
@@ -640,7 +640,10 @@
                 */
                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)) {

Modified: branches/SAMBA_3_2_0/source/locking/posix.c
===================================================================
--- branches/SAMBA_3_2_0/source/locking/posix.c 2007-08-20 07:30:59 UTC (rev 
24570)
+++ branches/SAMBA_3_2_0/source/locking/posix.c 2007-08-20 07:59:22 UTC (rev 
24571)
@@ -640,7 +640,10 @@
                 */
                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)) {

Reply via email to