When going through /proc the last entry made readdir() to alter errno,
which made the strtol() to think something went wrong, resulting kill(1)
tests to fail when running in --parallel mode.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
if (!isdigit((unsigned char) *d->d_name))
continue;
-
+ errno = 0;
*tid = (pid_t) strtol(d->d_name, &end, 10);
if (errno || d->d_name == end || (end && *end))
return -1;
}
p = NULL;
+ errno = 0;
*pid = (pid_t) strtol(d->d_name, &p, 10);
if (errno || d->d_name == p || (p && *p))
return errno ? -errno : -1;