From ca456fbba33d00a12bcec06589a08a4e9a081afd Mon Sep 17 00:00:00 2001
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
Date: Thu, 25 Apr 2019 20:29:54 +0100
Subject: [PATCH] 44284: Mark SIGQUIT as ignore if ignored on entry to shell.

This prevents us from re-enabling it after a fork if it is being
ignored.
---
 ChangeLog  | 5 +++++
 Src/init.c | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index a5ac4f333..1bb443f6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-25  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 44248: Src/init.c: Mark SIGQUIT as ignored if ignored at
+	shell start, so we don't enable it after a fork.
+
 2019-04-25  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 44254: Src/compat.c: make quite sure we've reached "/"
diff --git a/Src/init.c b/Src/init.c
index e7e62e2f7..2d5c3296d 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1234,6 +1234,15 @@ init_signals(void)
 
     intr();
 
+#ifdef POSIX_SIGNALS
+    {
+	struct sigaction act;
+	if (!sigaction(SIGQUIT, NULL, &act) &&
+	    act.sa_handler == SIG_IGN)
+	    sigtrapped[SIGQUIT] = ZSIG_IGNORED;
+    }
+#endif
+
 #ifndef QDEBUG
     signal_ignore(SIGQUIT);
 #endif