diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-11 12:33:06 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-11 12:40:27 +0100 |
commit | 8e143a123276a9636987b08f555603927ca9e186 (patch) | |
tree | cc6ad8c5ffd0f6ab8f4e61864c5f946f0cfc799d /src | |
parent | a90db619ca7acd7696d9d18d2d8a8c5206281757 (diff) | |
download | systemd-8e143a123276a9636987b08f555603927ca9e186.tar.gz systemd-8e143a123276a9636987b08f555603927ca9e186.tar.bz2 systemd-8e143a123276a9636987b08f555603927ca9e186.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/journal/journalctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b7cef573e3..8c9a6106df 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."); |