diff options
author | Volker Lendecke <vl@samba.org> | 2008-01-26 10:39:21 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-02-02 11:03:23 +0100 |
commit | b42a5d68a3ffd88fd60c64b6a75fe2d687d9c92d (patch) | |
tree | b8e1b6e204742449977b1731649e99cfbd9da86a /source3/lib | |
parent | 21e7344d2f45416ea996f88be72de1a923c0ee9c (diff) | |
download | samba-b42a5d68a3ffd88fd60c64b6a75fe2d687d9c92d.tar.gz samba-b42a5d68a3ffd88fd60c64b6a75fe2d687d9c92d.tar.bz2 samba-b42a5d68a3ffd88fd60c64b6a75fe2d687d9c92d.zip |
Convert read_data() to NTSTATUS
(This used to be commit af40b71023f8c4a2133d996ea698c72b97624043)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_sock.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index ede2cdae71..25d539cace 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1046,30 +1046,9 @@ NTSTATUS read_socket_with_timeout(int fd, char *buf, Read data from the client, reading exactly N bytes. ****************************************************************************/ -ssize_t read_data(int fd,char *buffer,size_t N, enum smb_read_errors *pre) +NTSTATUS read_data(int fd, char *buffer, size_t N) { - NTSTATUS status; - - set_smb_read_error(pre, SMB_READ_OK); - - status = read_socket_with_timeout(fd, buffer, N, N, 0, NULL); - - if (NT_STATUS_IS_OK(status)) { - return N; - } - - if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) { - set_smb_read_error(pre, SMB_READ_EOF); - return -1; - } - - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - set_smb_read_error(pre, SMB_READ_TIMEOUT); - return -1; - } - - set_smb_read_error(pre, SMB_READ_ERROR); - return -1; + return read_socket_with_timeout(fd, buffer, N, N, 0, NULL); } /**************************************************************************** |