2007-10-13 Ulrich Drepper <drepper@redhat.com>
+ [BZ #3195]
+ * nscd/nscd_getai.c (__nscd_getai): Set errno to 0 in case we found
+ no entry.
+ * nscd/nscd_getgr.c (nscd_getgr_r): Likewise.
+ * nscd/nscd_gethst_r.c (nscd_gethst_r): Likewise.
+ * nscd/nscd_getpw_r.c (nscd_getpw_r): Likewise.
+ * nscd/nscd_getserv_r.c (nscd_getserv_r): Likewise.
+
* nscd/nscd_getgr_r.c (nscd_getgr_r): Optimize a bit: use simpler
read mechanism when there are no group members and avoid no-op
read syscall in this case.
/* Store the error number. */
*h_errnop = ai_resp.error;
- /* The `errno' to some value != ERANGE. */
- __set_errno (ENOENT);
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
/* Even though we have not found anything, the result is zero. */
retval = 0;
}
}
else
{
- /* The `errno' to some value != ERANGE. */
- __set_errno (ENOENT);
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
/* Even though we have not found anything, the result is zero. */
retval = 0;
}
/* Store the error number. */
*h_errnop = hst_resp.error;
- /* The `errno' to some value != ERANGE. */
- __set_errno (ENOENT);
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
/* Even though we have not found anything, the result is zero. */
retval = 0;
}
}
else
{
- /* The `errno' to some value != ERANGE. */
- __set_errno (ENOENT);
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
/* Even though we have not found anything, the result is zero. */
retval = 0;
}
}
else
{
- /* The `errno' to some value != ERANGE. */
- __set_errno (ENOENT);
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
/* Even though we have not found anything, the result is zero. */
retval = 0;
}
/* Extra time we wait if the socket is still receiving data. This
- value is in microseconds. Note that the other side is nscd on the
+ value is in milliseconds. Note that the other side is nscd on the
local machine and it is already transmitting data. So the wait
time need not be long. */
#define EXTRA_RECEIVE_TIME 200