2000-05-07 Ulrich Drepper <drepper@redhat.com>
+ * inet/rcmd.c (rcmd_af): errno is not set if read returns without
+ reading anything. Reported by Andries.Brouwer@cwi.nl.
+
* sysdeps/generic/memccpy.c (__memccpy): Don't use reg_char type
for x since promotion in comparison might leads to unexpected
results. Reported by Dan Pop <Dan.Pop@cern.ch>.
char c;
int refused;
char num[8];
+ ssize_t n;
if (af != AF_INET && af != AF_INET6)
{
(void)__write(s, locuser, strlen(locuser)+1);
(void)__write(s, remuser, strlen(remuser)+1);
(void)__write(s, cmd, strlen(cmd)+1);
- if (__read(s, &c, 1) != 1) {
- (void)fprintf(stderr,
- "rcmd: %s: %m\n", *ahost);
+ n = __read(s, &c, 1);
+ if (n != 1) {
+ if (n == 0)
+ (void)fprintf(stderr, _("rcmd: %s: short read"),
+ *ahost);
+ else
+ (void)fprintf(stderr, "rcmd: %s: %m\n", *ahost);
goto bad2;
}
if (c != 0) {