summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-26 10:39:21 +0100
committerVolker Lendecke <vl@samba.org>2008-02-02 11:03:23 +0100
commitb42a5d68a3ffd88fd60c64b6a75fe2d687d9c92d (patch)
treeb8e1b6e204742449977b1731649e99cfbd9da86a /source3/winbindd
parent21e7344d2f45416ea996f88be72de1a923c0ee9c (diff)
downloadsamba-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/winbindd')
-rw-r--r--source3/winbindd/winbindd_dual.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 1f2972f9b2..48f37af4d0 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -40,15 +40,16 @@ extern struct winbindd_methods cache_methods;
static void child_read_request(struct winbindd_cli_state *state)
{
- ssize_t len;
+ NTSTATUS status;
/* Read data */
- len = read_data(state->sock, (char *)&state->request,
- sizeof(state->request), NULL);
+ status = read_data(state->sock, (char *)&state->request,
+ sizeof(state->request));
- if (len != sizeof(state->request)) {
- DEBUG(len > 0 ? 0 : 3, ("Got invalid request length: %d\n", (int)len));
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(3, ("child_read_request: read_data failed: %s\n",
+ nt_errstr(status)));
state->finished = True;
return;
}
@@ -72,11 +73,12 @@ static void child_read_request(struct winbindd_cli_state *state)
/* Ensure null termination */
state->request.extra_data.data[state->request.extra_len] = '\0';
- len = read_data(state->sock, state->request.extra_data.data,
- state->request.extra_len, NULL);
+ status= read_data(state->sock, state->request.extra_data.data,
+ state->request.extra_len);
- if (len != state->request.extra_len) {
- DEBUG(0, ("Could not read extra data\n"));
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Could not read extra data: %s\n",
+ nt_errstr(status)));
state->finished = True;
return;
}