aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorITOH Yasufumi <itohy@NetBSD.org>2016-11-06 19:29:04 +0000
committerThomas Klausner <wiz@NetBSD.org>2016-11-06 19:29:04 +0000
commit73d015d4bbaf03fec0afb5ba963e12c7b9e45d92 (patch)
tree24540bbb0443e86ca09f94bc824f41fdec14d184 /main.c
parentUpdate ChangeLog (diff)
downloadw3m-73d015d4bbaf03fec0afb5ba963e12c7b9e45d92.tar.gz
w3m-73d015d4bbaf03fec0afb5ba963e12c7b9e45d92.zip
Fix suspend (^Z) behavior.
Suspend the job w3m belongs to, not w3m only. Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index bd424de..85b0003 100644
--- a/main.c
+++ b/main.c
@@ -2619,7 +2619,17 @@ DEFUN(susp, INTERRUPT SUSPEND, "Suspend w3m to background")
shell = "/bin/sh";
system(shell);
#else /* SIGSTOP */
+#ifdef SIGTSTP
+ signal(SIGTSTP, SIG_DFL); /* just in case */
+ /*
+ * Note: If susp() was called from SIGTSTP handler,
+ * unblocking SIGTSTP would be required here.
+ * Currently not.
+ */
+ kill(0, SIGTSTP); /* stop whole job, not a single process */
+#else
kill((pid_t) 0, SIGSTOP);
+#endif
#endif /* SIGSTOP */
fmInit();
displayBuffer(Currentbuf, B_FORCE_REDRAW);