about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-08-18 21:21:17 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-08-18 21:21:17 +0000
commitef9b4ad79e745fc3add4f4a3f4d45cc841214805 (patch)
tree22f0d2ed9c1a22b875292e7b110f7c1365c6a12f /Src/jobs.c
parenta15007fe649d748783a166c3a016f2c2cb220b3f (diff)
downloadzsh-ef9b4ad79e745fc3add4f4a3f4d45cc841214805.tar.gz
zsh-ef9b4ad79e745fc3add4f4a3f4d45cc841214805.tar.xz
zsh-ef9b4ad79e745fc3add4f4a3f4d45cc841214805.zip
28172: mark processes as not stopped if sent SIGCONT
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 6c080de0c..a40291a88 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -2217,7 +2217,7 @@ bin_kill(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
 	    signal. */
 	    if (jobtab[p].stat & STAT_STOPPED) {
 		if (sig == SIGCONT)
-		    jobtab[p].stat &= ~STAT_STOPPED;
+		    makerunning(jobtab + p);
 		if (sig != SIGKILL && sig != SIGCONT && sig != SIGTSTP
 		    && sig != SIGTTOU && sig != SIGTTIN && sig != SIGSTOP)
 		    killjb(jobtab + p, SIGCONT);
@@ -2225,9 +2225,19 @@ bin_kill(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
 	} else if (!isanum(*argv)) {
 	    zwarnnam("kill", "illegal pid: %s", *argv);
 	    returnval++;
-	} else if (kill(atoi(*argv), sig) == -1) {
-	    zwarnnam("kill", "kill %s failed: %e", *argv, errno);
-	    returnval++;
+	} else {
+	    int pid = atoi(*argv);
+	    if (kill(pid, sig) == -1) {
+		zwarnnam("kill", "kill %s failed: %e", *argv, errno);
+		returnval++;
+	    } else if (sig == SIGCONT) {
+		Job jn;
+		Process pn;
+		if (findproc(pid, &jn, &pn, 0)) {
+		    if (WIFSTOPPED(pn->status))
+			pn->status = SP_RUNNING;
+		}
+	    }
 	}
     }
     unqueue_signals();