From: Zbigniew Jędrzejewski-Szmek Date: Sun, 11 Nov 2018 11:33:06 +0000 (+0100) Subject: journalctl: do not treat EINTR as an error when waiting for events X-Git-Tag: v240~359^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10728%2Fhead;p=thirdparty%2Fsystemd.git journalctl: do not treat EINTR as an error when waiting for events Fixup for 2a1e0f2228bbdfbc18635e959f47df7da50b62fe. Fixes #10724. Reproducer: start 'journalctl -f' in a terminal window, change window size. --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b7cef573e30..8c9a6106df4 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -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.");