}
else
{
- close_fd (fd, pretty_name (f));
+ if (f->fd == -1)
+ {
+ /* This happens when one iteration finds the file missing,
+ then the preceding <dev,inode> pair is reused as the
+ file is recreated. */
+ new_file = 1;
+ }
+ else
+ {
+ close_fd (fd, pretty_name (f));
+ }
}
if (new_file)
if (fstat (f[i].fd, &stats) < 0)
{
- error (0, errno, "%s", pretty_name (&f[i]));
f[i].fd = -1;
f[i].errnum = errno;
+ error (0, errno, "%s", pretty_name (&f[i]));
continue;
}
/* FIXME: duplicate code */
if (fstat (fd, &stats) < 0)
{
- error (0, errno, "%s", pretty_name (f));
errors = 1;
f->errnum = errno;
+ error (0, errno, "%s", pretty_name (f));
}
if (errors)