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