]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Change fd_close_posix() to return int instead of NTSTATUS.
authorMichael Adam <obnox@samba.org>
Fri, 11 Jan 2008 12:28:28 +0000 (13:28 +0100)
committerMichael Adam <obnox@samba.org>
Sun, 20 Apr 2008 22:21:24 +0000 (00:21 +0200)
The errno is handed up through the VFS layer to the callers.

Michael

source/locking/posix.c
source/modules/vfs_default.c

index 844a86e8636ae14f77c1d3deddae039727841427..aedc12dedea80e3fbebb07f8f2d6b5e717dbb551 100644 (file)
@@ -607,7 +607,7 @@ static size_t get_posix_pending_close_entries(TALLOC_CTX *mem_ctx,
  to delete all locks on this fsp before this function is called.
 ****************************************************************************/
 
-NTSTATUS fd_close_posix(struct files_struct *fsp)
+int fd_close_posix(struct files_struct *fsp)
 {
        int saved_errno = 0;
        int ret;
@@ -620,11 +620,7 @@ NTSTATUS fd_close_posix(struct files_struct *fsp)
                 * which will lose all locks on all fd's open on this dev/inode,
                 * just close.
                 */
-               ret = close(fsp->fh->fd);
-               if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
-               }
-               return NT_STATUS_OK;
+               return close(fsp->fh->fd);
        }
 
        if (get_windows_lock_ref_count(fsp)) {
@@ -635,7 +631,7 @@ NTSTATUS fd_close_posix(struct files_struct *fsp)
                 */
 
                add_fd_to_close_entry(fsp);
-               return NT_STATUS_OK;
+               return 0;
        }
 
        /*
@@ -678,11 +674,7 @@ NTSTATUS fd_close_posix(struct files_struct *fsp)
                ret = -1;
        } 
 
-       if (ret == -1) {
-               return map_nt_error_from_unix(errno);
-       }
-
-       return NT_STATUS_OK;
+       return ret;
 }
 
 /****************************************************************************
index 9887b309f95fd0a6b49764f50ff42b14e986cb80..a03f4dcef9ddad3f2c7540b8aa4f92eb47982b86 100644 (file)
@@ -210,13 +210,12 @@ static int vfswrap_open(vfs_handle_struct *handle,  const char *fname,
 
 static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
 {
-       NTSTATUS result;
+       int result;
 
        START_PROFILE(syscall_close);
        result = fd_close_posix(fsp);
        END_PROFILE(syscall_close);
-
-       return NT_STATUS_IS_OK(result) ? 0 : -1;
+       return result;
 }
 
 static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)