journalctl: do not treat EINTR as an error when waiting for events

Fixup for 2a1e0f2228. Fixes #10724.

Reproducer: start 'journalctl -f' in a terminal window, change window size.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-11-11 12:33:06 +01:00
parent a90db619ca
commit 8e143a1232
1 changed files with 6 additions and 1 deletions

View File

@ -2058,8 +2058,13 @@ static int wait_for_change(sd_journal *j, int poll_fd) {
if (r < 0)
return log_error_errno(r, "Failed to determine journal waiting time: %m");
if (ppoll(pollfds, ELEMENTSOF(pollfds), timeout == USEC_INFINITY ? NULL : timespec_store(&ts, timeout), NULL) < 0)
if (ppoll(pollfds, ELEMENTSOF(pollfds),
timeout == USEC_INFINITY ? NULL : timespec_store(&ts, timeout), NULL) < 0) {
if (errno == EINTR)
return 0;
return log_error_errno(errno, "Couldn't wait for journal event: %m");
}
if (pollfds[1].revents & (POLLHUP|POLLERR)) { /* STDOUT has been closed? */
log_debug("Standard output has been closed.");