From: Felix Riemann Date: Wed, 29 May 2019 19:17:42 +0000 (+0200) Subject: pager: Fix deadlock when using built-in pager X-Git-Tag: archive/raspbian/241-7_deb10u9+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7c40b57d052bb6538f147dca0e2e7814e73d80cb;p=systemd.git pager: Fix deadlock when using built-in pager The parent is waiting for an EOF on the pipe transmitting the pager name before starting to send data. With external pagers this happens due to execlp() CLOEXEC'ing the pipe, so the internal pager needs to close it manually. Gbp-Pq: Name 0003-pager-Fix-deadlock-when-using-built-in-pager.patch --- diff --git a/src/shared/pager.c b/src/shared/pager.c index 7a562717..6f1d57a0 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -212,11 +212,13 @@ int pager_open(PagerFlags flags) { "Failed to execute '%s', using next fallback pager: %m", exe); } - r = loop_write(exe_name_pipe[1], "(built-in)", strlen("(built-in") + 1, false); + r = loop_write(exe_name_pipe[1], "(built-in)", strlen("(built-in)") + 1, false); if (r < 0) { log_error_errno(r, "Failed to write pager name to socket: %m"); _exit(EXIT_FAILURE); } + /* Close pipe to signal the parent to start sending data */ + safe_close_pair(exe_name_pipe); pager_fallback(); /* not reached */ }