From 32ce9de932c3f08b728bd9c743c70d702dc68a88 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 22 Aug 2007 13:51:44 +0000 Subject: r24629: Make read_sock return the total number of bytes read instead of the number of bytes read in the last of possibly several read calls. This was noted by Metze. Michael (This used to be commit 37363307c6cbe28f1ca7135ca501d8c0dcd4c6d7) --- source4/nsswitch/wb_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source4/nsswitch/wb_common.c b/source4/nsswitch/wb_common.c index e2b84e9f69..e8ea31db0f 100644 --- a/source4/nsswitch/wb_common.c +++ b/source4/nsswitch/wb_common.c @@ -421,7 +421,7 @@ int write_sock(void *buffer, int count) static int read_sock(void *buffer, int count) { - int result = 0, nread = 0; + int nread = 0; int total_time = 0, selret; /* Read data from socket */ @@ -458,7 +458,7 @@ static int read_sock(void *buffer, int count) /* Do the Read */ - result = read(winbindd_fd, (char *)buffer + nread, + int result = read(winbindd_fd, (char *)buffer + nread, count - nread); if ((result == -1) || (result == 0)) { @@ -476,7 +476,7 @@ static int read_sock(void *buffer, int count) } } - return result; + return nread; } /* Read reply */ -- cgit