about summary refs log tree commit diff
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
parenta15007fe649d748783a166c3a016f2c2cb220b3f (diff)
downloadzsh-ef9b4ad79e745fc3add4f4a3f4d45cc841214805.tar.gz
zsh-ef9b4ad79e745fc3add4f4a3f4d45cc841214805.tar.xz
zsh-ef9b4ad79e745fc3add4f4a3f4d45cc841214805.zip
28172: mark processes as not stopped if sent SIGCONT
-rw-r--r--ChangeLog7
-rw-r--r--Src/jobs.c18
2 files changed, 20 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index dc310e88a..4faa2a04b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-18  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 28172: Src/jobs.c: mark processes as not stopped if
+	sent SIGCONT.
+
 2010-08-15  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 28167: Src/Zle/compresult.c: reset more variables when
@@ -13530,5 +13535,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5057 $
+* $Revision: 1.5058 $
 *****************************************************
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();