(nscd_getgr_r): Store result of successful read from nscd.
authordrepper <drepper>
Mon, 15 Oct 2007 03:19:25 +0000 (03:19 +0000)
committerdrepper <drepper>
Mon, 15 Oct 2007 03:19:25 +0000 (03:19 +0000)
nscd/nscd_getgr_r.c

index afb4d20..b84b06b 100644 (file)
@@ -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
        {