aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-11-07 10:32:29 +0000
committerGitHub <noreply@github.com>2016-11-07 10:32:29 +0000
commit27b0e9d449ea0114d2364b202e5f4004df6f95e8 (patch)
treef642472a0f1cea68561e1892407b72687cfdfe18
parentPrevent dereference near-null pointer in formUpdateBuffer (diff)
parentFix suspend (^Z) behavior. (diff)
downloadw3m-27b0e9d449ea0114d2364b202e5f4004df6f95e8.tar.gz
w3m-27b0e9d449ea0114d2364b202e5f4004df6f95e8.zip
Merge pull request #34 from 0-wiz-0/master
Fix suspend (^Z) behavior.
Diffstat (limited to '')
-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);