summaryrefslogtreecommitdiff
path: root/Src/signals.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-12-24 04:40:22 +0100
committerAxel Beckert <abe@deuxchevaux.org>2018-12-24 04:40:22 +0100
commitbf8b7f713a5b04a191f4596fb86bbbfca0a855ce (patch)
treeb647a8dc990c8c845b8a8eca7bf92fbbf17e1fb5 /Src/signals.c
parent06946d431a4426c6e5dffec1d7edb17c1dbd467c (diff)
parent9dbde9e9c7d22ee0d301e4a2fecf97906d1ddce9 (diff)
downloadzsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.tar.gz
zsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.zip
New upstream release candidate 5.6.2-test-2
Merge branch 'upstream' at 'zsh-5.6.2-test-2' into branch debian
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/Src/signals.c b/Src/signals.c
index 99aad0fab..f294049c2 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -540,8 +540,8 @@ wait_for_processes(void)
if (WIFEXITED(status) &&
pn->pid == jn->gleader &&
killpg(pn->pid, 0) == -1) {
- jn->gleader = 0;
- if (!(jn->stat & STAT_NOSTTY)) {
+ if (last_attached_pgrp == jn->gleader &&
+ !(jn->stat & STAT_NOSTTY)) {
/*
* This PID was in control of the terminal;
* reclaim terminal now it has exited.
@@ -552,6 +552,7 @@ wait_for_processes(void)
attachtty(mypgrp);
adjustwinsize(0);
}
+ jn->gleader = 0;
}
}
update_job(jn);
@@ -781,7 +782,20 @@ killjb(Job jn, int sig)
if (kill(pn->pid, sig) == -1 && errno != ESRCH)
err = -1;
- return err;
+ /*
+ * The following marks both the superjob and subjob
+ * as running, as done elsewhere.
+ *
+ * It's not entirely clear to me what the right way
+ * to flag the status of a still-pausd final process,
+ * as handled above, but we should be cnsistent about
+ * this inside makerunning() rather than doing anything
+ * special here.
+ */
+ if (err != -1)
+ makerunning(jn);
+
+ return err;
}
if (killpg(jobtab[jn->other].gleader, sig) == -1 && errno != ESRCH)
err = -1;
@@ -791,8 +805,11 @@ killjb(Job jn, int sig)
return err;
}
- else
- return killpg(jn->gleader, sig);
+ else {
+ err = killpg(jn->gleader, sig);
+ if (sig == SIGCONT && err != -1)
+ makerunning(jn);
+ }
}
for (pn = jn->procs; pn; pn = pn->next) {
/*