* src/tail.c (check_fspec): Save fstat-induced errno *before*
calling close_fd, not after. Otherwise, the close could well
clobber the global errno, making tail print an invalid diagnostic.
This could happen only with tail -f, and even then, only when
a valid file descriptor were to provoke fstat failure.
if (fstat (fspec->fd, &stats) != 0)
{
+ fspec->errnum = errno;
close_fd (fspec->fd, name);
fspec->fd = -1;
- fspec->errnum = errno;
return;
}