about summary refs log tree commit diff
path: root/nscd/nscd_getgr_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-15 03:19:44 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-15 03:19:44 +0000
commit895a08c0897a753a30250bb4995b5cf771ee0084 (patch)
tree9998c38bc07be03b4828fa6ad224c5fef73c8884 /nscd/nscd_getgr_r.c
parent8d62c8ab01941113060039be65ff0b506f0194a2 (diff)
downloadglibc-895a08c0897a753a30250bb4995b5cf771ee0084.tar.gz
glibc-895a08c0897a753a30250bb4995b5cf771ee0084.tar.xz
glibc-895a08c0897a753a30250bb4995b5cf771ee0084.zip
* nscd/nscd_getgr_r.c (nscd_getgr_r): Store result of successful
	read from nscd.
Diffstat (limited to 'nscd/nscd_getgr_r.c')
-rw-r--r--nscd/nscd_getgr_r.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c
index afb4d20435..b84b06b3ce 100644
--- a/nscd/nscd_getgr_r.c
+++ b/nscd/nscd_getgr_r.c
@@ -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
 	{