diff options
author | Michael Adam <obnox@samba.org> | 2007-08-22 13:51:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:11 -0500 |
commit | 0193a49223c6314e2834c89fff9920ae7edc4f8a (patch) | |
tree | ec887da79592ed5d3aec2c3fa9282b5c28e19701 /source/nsswitch/wb_common.c | |
parent | ddbe971030070ab1b9fc37b8b0ac44a3d9303fe4 (diff) | |
download | samba-0193a49223c6314e2834c89fff9920ae7edc4f8a.tar.gz samba-0193a49223c6314e2834c89fff9920ae7edc4f8a.tar.xz samba-0193a49223c6314e2834c89fff9920ae7edc4f8a.zip |
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
Diffstat (limited to 'source/nsswitch/wb_common.c')
-rw-r--r-- | source/nsswitch/wb_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c index 52913668e58..5072b81515f 100644 --- a/source/nsswitch/wb_common.c +++ b/source/nsswitch/wb_common.c @@ -420,7 +420,7 @@ int write_sock(void *buffer, int count, int recursing, int need_priv) static int read_sock(void *buffer, int count) { - int result = 0, nread = 0; + int nread = 0; int total_time = 0, selret; if (winbindd_fd == -1) { @@ -461,7 +461,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)) { @@ -479,7 +479,7 @@ static int read_sock(void *buffer, int count) } } - return result; + return nread; } /* Read reply */ |