diff options
| author | Warner Losh <imp@FreeBSD.org> | 2023-02-19 03:04:29 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2023-02-19 03:09:26 +0000 |
| commit | ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba (patch) | |
| tree | 1d88a827a6604d5829b12e0235924431f55124a8 /usr.bin/tail | |
| parent | e600bcfb871ccd70262a0bf0695e929331cae83d (diff) | |
Diffstat (limited to 'usr.bin/tail')
| -rw-r--r-- | usr.bin/tail/forward.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 3897d115effd..6dbeb9cdd047 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -411,10 +411,16 @@ follow(file_info_t *files, enum STYLE style, off_t off) /* * In the -F case we set a timeout to ensure that * we re-stat the file at least once every second. + * If we've recieved EINTR, ignore it. Both reasons + * for its generation are transient. */ - n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); - if (n < 0) - err(1, "kevent"); + do { + n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); + if (n < 0 && errno == EINTR) + continue; + if (n < 0) + err(1, "kevent"); + } while (n < 0); if (n == 0) { /* timeout */ break; |
