Skip to content

Commit

Permalink
* nscd/nscd_getgr_r.c (nscd_getgr_r): Store result of successful
Browse files Browse the repository at this point in the history
	read from nscd.
  • Loading branch information
Ulrich Drepper committed Oct 15, 2007
1 parent 8d62c8a commit 895a08c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2007-10-14 Ulrich Drepper <drepper@redhat.com>

* nscd/nscd_getgr_r.c (nscd_getgr_r): Store result of successful
read from nscd.

* sysdeps/posix/getaddrinfo.c (struct sort_result): Add
service_order.
(rfc3484_sort): Make sure that even if qsort doesn't support
Expand Down
18 changes: 8 additions & 10 deletions nscd/nscd_getgr_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,16 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
/* If there are no group members TOTAL_LEN is zero. */
if (gr_name == NULL)
{
if (total_len > 0)
if (total_len > 0
&& __builtin_expect (__readall (sock, resultbuf->gr_mem[0],
total_len) != total_len, 0))
{
size_t n = __readall (sock, resultbuf->gr_mem[0], total_len);
if (__builtin_expect (n != total_len, 0))
{
/* The `errno' to some value != ERANGE. */
__set_errno (ENOENT);
retval = ENOENT;
}
else
*result = resultbuf;
/* The `errno' to some value != ERANGE. */
__set_errno (ENOENT);
retval = ENOENT;
}
else
*result = resultbuf;
}
else
{
Expand Down

0 comments on commit 895a08c

Please sign in to comment.