* src/tail.c (tail_forever_inotify): Handle the special case in which
an old inotify watcher returns 0. Affects kernels in [2.6.13, 2.6.21).
evbuf_off = 0;
/* For kernels prior to 2.6.21, read returns 0 when the buffer
- is too small. FIXME: handle that. */
- if (len == SAFE_READ_ERROR && errno == EINVAL && max_realloc--)
+ is too small. */
+ if ((len == 0 || (len == SAFE_READ_ERROR && errno == EINVAL))
+ && max_realloc--)
{
len = 0;
evlen *= 2;
continue;
}
- if (len == SAFE_READ_ERROR)
+ if (len == 0 || len == SAFE_READ_ERROR)
error (EXIT_FAILURE, errno, _("error reading inotify event"));
}