summaryrefslogtreecommitdiffstats
path: root/debian/patches/0003-pager-Fix-deadlock-when-using-built-in-pager.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0003-pager-Fix-deadlock-when-using-built-in-pager.patch')
-rw-r--r--debian/patches/0003-pager-Fix-deadlock-when-using-built-in-pager.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/0003-pager-Fix-deadlock-when-using-built-in-pager.patch b/debian/patches/0003-pager-Fix-deadlock-when-using-built-in-pager.patch
new file mode 100644
index 0000000..ab5a229
--- /dev/null
+++ b/debian/patches/0003-pager-Fix-deadlock-when-using-built-in-pager.patch
@@ -0,0 +1,35 @@
+From d982f0decd1215d6fbd60c0e9ce6c0ffb8a0188c Mon Sep 17 00:00:00 2001
+From: Felix Riemann <felix.riemann@sma.de>
+Date: Wed, 29 May 2019 21:17:42 +0200
+Subject: 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.
+---
+ src/shared/pager.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/shared/pager.c b/src/shared/pager.c
+index 7a56271760..6f1d57a096 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 */
+ }
+--
+2.30.2
+