ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
ac3a84
From b277e35fdb56560110e8b96fb90042ff2e19a2c5 Mon Sep 17 00:00:00 2001
ac3a84
From: Lennart Poettering <lennart@poettering.net>
ac3a84
Date: Tue, 22 Nov 2022 12:18:07 +0100
ac3a84
Subject: [PATCH] stdio-bridge: don't be bothered with EINTR
ac3a84
ac3a84
We handle signals via signal handlers, hence no need to be concerned
ac3a84
about EINTR.
ac3a84
ac3a84
(cherry picked from commit 7c75f34131772781f690860de797d3e35fd0bed9)
ac3a84
ac3a84
Related: #2137584
ac3a84
---
ac3a84
 src/stdio-bridge/stdio-bridge.c | 5 ++++-
ac3a84
 1 file changed, 4 insertions(+), 1 deletion(-)
ac3a84
ac3a84
diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c
ac3a84
index c851059a09..1b94374b4b 100644
ac3a84
--- a/src/stdio-bridge/stdio-bridge.c
ac3a84
+++ b/src/stdio-bridge/stdio-bridge.c
ac3a84
@@ -242,8 +242,11 @@ static int run(int argc, char *argv[]) {
ac3a84
                 };
ac3a84
 
ac3a84
                 r = ppoll_usec(p, ELEMENTSOF(p), t);
ac3a84
-                if (r < 0)
ac3a84
+                if (r < 0) {
ac3a84
+                        if (ERRNO_IS_TRANSIENT(r)) /* don't be bothered by signals, i.e. EINTR */
ac3a84
+                                continue;
ac3a84
                         return log_error_errno(r, "ppoll() failed: %m");
ac3a84
+                }
ac3a84
         }
ac3a84
 
ac3a84
         return 0;