summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-11-19 14:06:49 +0000
committerJeremy Allison <jra@samba.org>2014-12-07 00:12:07 +0100
commita8491cb95a2c181d40b0b94cceff8d69d137935c (patch)
tree6bdf806d414b886bc8a4480c508000b16c27cb6a
parent97b2570a5e526273476d3990bcef0ac074b34d67 (diff)
downloadsamba-a8491cb95a2c181d40b0b94cceff8d69d137935c.tar.gz
samba-a8491cb95a2c181d40b0b94cceff8d69d137935c.tar.xz
samba-a8491cb95a2c181d40b0b94cceff8d69d137935c.zip
lib: read_data->read_data_ntstatus
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/ctdbd_conn.c6
-rw-r--r--source3/lib/util_sock.c2
-rw-r--r--source3/nmbd/asyncdns.c4
-rw-r--r--source3/smbd/notify_inotify.c2
-rw-r--r--source3/smbd/reply.c3
-rw-r--r--source3/winbindd/winbindd_dual.c5
7 files changed, 13 insertions, 11 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 68a3053a7b..dcecf74a86 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 5dc007bf5c..7bdb37664f 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 2bed9a9063..d93e22d702 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 90340efe39..4468c7ba5d 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 1fcd8ecd73..a9b7131ef7 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 fd4ec53aed..cd13d68092 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 b9c110f9b2..43a27b3f4d 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)));