mirror of
https://github.com/samba-team/samba.git
synced 2025-10-24 15:33:20 +03:00
lib: read_data->read_data_ntstatus
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
97b2570a5e
commit
a8491cb95a
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user