From b42a5d68a3ffd88fd60c64b6a75fe2d687d9c92d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 26 Jan 2008 10:39:21 +0100 Subject: Convert read_data() to NTSTATUS (This used to be commit af40b71023f8c4a2133d996ea698c72b97624043) --- source3/lib/util_sock.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'source3/lib') 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); } /**************************************************************************** -- cgit