|
|
6f381c |
From b0574acc0bddceb0af47f6cce327a87041ab4b52 Mon Sep 17 00:00:00 2001
|
|
|
6f381c |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
6f381c |
Date: Sun, 11 Nov 2018 12:33:06 +0100
|
|
|
6f381c |
Subject: [PATCH] journalctl: do not treat EINTR as an error when waiting for
|
|
|
6f381c |
events
|
|
|
6f381c |
|
|
|
6f381c |
Fixup for 2a1e0f2228bbdfbc18635e959f47df7da50b62fe. Fixes #10724.
|
|
|
6f381c |
|
|
|
6f381c |
Reproducer: start 'journalctl -f' in a terminal window, change window size.
|
|
|
6f381c |
(cherry picked from commit 8e143a123276a9636987b08f555603927ca9e186)
|
|
|
6f381c |
|
|
|
6f381c |
Resolves: #2161683
|
|
|
6f381c |
---
|
|
|
6f381c |
src/journal/journalctl.c | 7 ++++++-
|
|
|
6f381c |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
6f381c |
|
|
|
6f381c |
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
|
|
|
6f381c |
index fa83dce562..228cfe7e49 100644
|
|
|
6f381c |
--- a/src/journal/journalctl.c
|
|
|
6f381c |
+++ b/src/journal/journalctl.c
|
|
|
6f381c |
@@ -2084,8 +2084,13 @@ static int wait_for_change(sd_journal *j, int poll_fd) {
|
|
|
6f381c |
if (r < 0)
|
|
|
6f381c |
return log_error_errno(r, "Failed to determine journal waiting time: %m");
|
|
|
6f381c |
|
|
|
6f381c |
- if (ppoll(pollfds, ELEMENTSOF(pollfds), timeout == USEC_INFINITY ? NULL : timespec_store(&ts, timeout), NULL) < 0)
|
|
|
6f381c |
+ if (ppoll(pollfds, ELEMENTSOF(pollfds),
|
|
|
6f381c |
+ timeout == USEC_INFINITY ? NULL : timespec_store(&ts, timeout), NULL) < 0) {
|
|
|
6f381c |
+ if (errno == EINTR)
|
|
|
6f381c |
+ return 0;
|
|
|
6f381c |
+
|
|
|
6f381c |
return log_error_errno(errno, "Couldn't wait for journal event: %m");
|
|
|
6f381c |
+ }
|
|
|
6f381c |
|
|
|
6f381c |
if (pollfds[1].revents & (POLLHUP|POLLERR)) { /* STDOUT has been closed? */
|
|
|
6f381c |
log_debug("Standard output has been closed.");
|