diff options
author | Jeremy Allison <jra@samba.org> | 2007-02-06 21:05:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:47 -0500 |
commit | 7a5fa7f12ec439ef5a4af29aa86498f799b6b9a5 (patch) | |
tree | 611c3787938bb8eb77a127a18a4932890ae2fd03 /source3/locking/posix.c | |
parent | c04068a42b230541559939004f33d72f1e76f075 (diff) | |
download | samba-7a5fa7f12ec439ef5a4af29aa86498f799b6b9a5.tar.gz samba-7a5fa7f12ec439ef5a4af29aa86498f799b6b9a5.tar.xz samba-7a5fa7f12ec439ef5a4af29aa86498f799b6b9a5.zip |
r21191: Add in the POSIX open/mkdir/unlink calls.
Move more error code returns to NTSTATUS.
Client test code to follow... See if this
passes the build-farm before I add it into
3.0.25.
Jeremy.
(This used to be commit 83dbbdff345fa9e427c9579183f4380004bf3dd7)
Diffstat (limited to 'source3/locking/posix.c')
-rw-r--r-- | source3/locking/posix.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 806018da816..62804eb8e34 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -636,7 +636,7 @@ static size_t get_posix_pending_close_entries(files_struct *fsp, int **entries) to delete all locks on this fsp before this function is called. ****************************************************************************/ -int fd_close_posix(struct connection_struct *conn, files_struct *fsp) +NTSTATUS fd_close_posix(struct connection_struct *conn, files_struct *fsp) { int saved_errno = 0; int ret; @@ -651,7 +651,7 @@ int fd_close_posix(struct connection_struct *conn, files_struct *fsp) */ ret = SMB_VFS_CLOSE(fsp,fsp->fh->fd); fsp->fh->fd = -1; - return ret; + return map_nt_error_from_unix(errno); } if (get_windows_lock_ref_count(fsp)) { @@ -663,7 +663,7 @@ int fd_close_posix(struct connection_struct *conn, files_struct *fsp) add_fd_to_close_entry(fsp); fsp->fh->fd = -1; - return 0; + return NT_STATUS_OK; } /* @@ -701,14 +701,18 @@ int fd_close_posix(struct connection_struct *conn, files_struct *fsp) ret = SMB_VFS_CLOSE(fsp,fsp->fh->fd); - if (saved_errno != 0) { + if (ret == 0 && saved_errno != 0) { errno = saved_errno; ret = -1; } fsp->fh->fd = -1; - return ret; + if (ret == -1) { + return map_nt_error_from_unix(errno); + } + + return NT_STATUS_OK; } /**************************************************************************** |