about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/jobs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 7b060cd87..81a0e2e8f 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -268,7 +268,8 @@ update_job(Job jn)
 	    }
 	    return;
 	}
-    } else {                   /* job is done, so remember return value */
+    }
+    {                   /* job is done or stopped, remember return value */
 	lastval2 = val;
 	/* If last process was run in the current shell, keep old status
 	 * and let it handle its own traps, but always allow the test
@@ -293,7 +294,7 @@ update_job(Job jn)
 	if (mypgrp != pgrp && inforeground &&
 	    (jn->gleader == pgrp || (pgrp > 1 && kill(-pgrp, 0) == -1))) {
 	    if (list_pipe) {
-		if (pgrp > 1 && kill(-pgrp, 0) == -1) {
+		if (somestopped || (pgrp > 1 && kill(-pgrp, 0) == -1)) {
 		    attachtty(mypgrp);
 		    /* check window size and adjust if necessary */
 		    adjustwinsize(0);