]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: do not treat EINTR as an error when waiting for events 10728/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 11 Nov 2018 11:33:06 +0000 (12:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 11 Nov 2018 11:40:27 +0000 (12:40 +0100)
Fixup for 2a1e0f2228bbdfbc18635e959f47df7da50b62fe. Fixes #10724.

Reproducer: start 'journalctl -f' in a terminal window, change window size.

src/journal/journalctl.c

index b7cef573e309d0af3e6fc2bf87dcb08e27675f5a..8c9a6106df42efb1b005878e622f0bde1edb6b95 100644 (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.");