From a8491cb95a2c181d40b0b94cceff8d69d137935c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 19 Nov 2014 14:06:49 +0000 Subject: [PATCH] lib: read_data->read_data_ntstatus Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/include/proto.h | 2 +- source3/lib/ctdbd_conn.c | 6 +++--- source3/lib/util_sock.c | 2 +- source3/nmbd/asyncdns.c | 4 ++-- source3/smbd/notify_inotify.c | 2 +- source3/smbd/reply.c | 3 ++- source3/winbindd/winbindd_dual.c | 5 +++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 68a3053a7b5..dcecf74a866 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -565,7 +565,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf, size_t mincnt, size_t maxcnt, unsigned int time_out, size_t *size_ret); -NTSTATUS read_data(int fd, char *buffer, size_t N); +NTSTATUS read_data_ntstatus(int fd, char *buffer, size_t N); ssize_t write_data(int fd, const char *buffer, size_t N); ssize_t iov_buflen(const struct iovec *iov, int iovlen); uint8_t *iov_buf(TALLOC_CTX *mem_ctx, const struct iovec *iov, int iovcnt); diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 5dc007bf5cb..7bdb37664f8 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -379,7 +379,7 @@ static NTSTATUS ctdb_read_packet(int fd, TALLOC_CTX *mem_ctx, } } - status = read_data(fd, (char *)&msglen, sizeof(msglen)); + status = read_data_ntstatus(fd, (char *)&msglen, sizeof(msglen)); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -396,8 +396,8 @@ static NTSTATUS ctdb_read_packet(int fd, TALLOC_CTX *mem_ctx, req->length = msglen; - status = read_data(fd, ((char *)req) + sizeof(msglen), - msglen - sizeof(msglen)); + status = read_data_ntstatus(fd, ((char *)req) + sizeof(msglen), + msglen - sizeof(msglen)); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 2bed9a90632..d93e22d702c 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -197,7 +197,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf, on socket calls. ****************************************************************************/ -NTSTATUS read_data(int fd, char *buffer, size_t N) +NTSTATUS read_data_ntstatus(int fd, char *buffer, size_t N) { return read_fd_with_timeout(fd, buffer, N, N, 0, NULL); } diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c index 90340efe397..4468c7ba5d4 100644 --- a/source3/nmbd/asyncdns.c +++ b/source3/nmbd/asyncdns.c @@ -90,7 +90,7 @@ static void asyncdns_process(void) while (1) { NTSTATUS status; - status = read_data(fd_in, (char *)&r, sizeof(r)); + status = read_data_ntstatus(fd_in, (char *)&r, sizeof(r)); if (!NT_STATUS_IS_OK(status)) { break; @@ -219,7 +219,7 @@ void run_dns_queue(struct messaging_context *msg) start_async_dns(msg); } - status = read_data(fd_in, (char *)&r, sizeof(r)); + status = read_data_ntstatus(fd_in, (char *)&r, sizeof(r)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("read from child failed: %s\n", nt_errstr(status))); diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c index 1fcd8ecd735..a9b7131ef75 100644 --- a/source3/smbd/notify_inotify.c +++ b/source3/smbd/notify_inotify.c @@ -219,7 +219,7 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde, if (e == NULL) return; ((uint8_t *)e)[bufsize] = '\0'; - status = read_data(in->fd, (char *)e0, bufsize); + status = read_data_ntstatus(in->fd, (char *)e0, bufsize); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to read all inotify data - %s\n", nt_errstr(status))); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index fd4ec53aed8..cd13d68092d 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -4366,7 +4366,8 @@ void reply_writebraw(struct smb_request *req) (int)tcount,(int)nwritten,(int)numtowrite)); } - status = read_data(xconn->transport.sock, buf+4, numtowrite); + status = read_data_ntstatus(xconn->transport.sock, buf+4, + numtowrite); if (!NT_STATUS_IS_OK(status)) { /* Try and give an error message diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index b9c110f9b2e..43a27b3f4da 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -53,7 +53,7 @@ static NTSTATUS child_read_request(int sock, struct winbindd_request *wreq) { NTSTATUS status; - status = read_data(sock, (char *)wreq, sizeof(*wreq)); + status = read_data_ntstatus(sock, (char *)wreq, sizeof(*wreq)); if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("child_read_request: read_data failed: %s\n", nt_errstr(status))); @@ -76,7 +76,8 @@ static NTSTATUS child_read_request(int sock, struct winbindd_request *wreq) /* Ensure null termination */ wreq->extra_data.data[wreq->extra_len] = '\0'; - status = read_data(sock, wreq->extra_data.data, wreq->extra_len); + status = read_data_ntstatus(sock, wreq->extra_data.data, + wreq->extra_len); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("Could not read extra data: %s\n", nt_errstr(status))); -- 2.34.1