about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c23
-rw-r--r--Src/signals.c3
2 files changed, 11 insertions, 15 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 88b90cfec..5d4b2be2c 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3159,25 +3159,22 @@ checkjobs(void)
 {
     int i;
 
-    for (i = 1; i < MAXJOB; i++) {
+    for (i = 1; i < MAXJOB; i++)
 	if (i != thisjob && (jobtab[i].stat & STAT_LOCKED) &&
-	    !(jobtab[i].stat & STAT_NOPRINT)) {
-	    if (jobtab[i].stat & STAT_STOPPED) {
+	    !(jobtab[i].stat & STAT_NOPRINT))
+	    break;
+    if (i < MAXJOB) {
+	if (jobtab[i].stat & STAT_STOPPED) {
 
 #ifdef USE_SUSPENDED
-		zerr("you have suspended jobs.", NULL, 0);
+	    zerr("you have suspended jobs.", NULL, 0);
 #else
-		zerr("you have stopped jobs.", NULL, 0);
+	    zerr("you have stopped jobs.", NULL, 0);
 #endif
 
-		stopmsg = 1;
-	    } else if (isset(HUP)) {
-		zerr("you have running jobs.", NULL, 0);
-		stopmsg = 1;
-	    }
-	    if (stopmsg)
-		break;
-	}
+	} else
+	    zerr("you have running jobs.", NULL, 0);
+	stopmsg = 1;
     }
 }
 
diff --git a/Src/signals.c b/Src/signals.c
index 8908a7958..5a2d62c25 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -572,8 +572,7 @@ killrunjobs(int from_signal)
         if ((from_signal || i != thisjob) && (jobtab[i].stat & STAT_LOCKED) &&
             !(jobtab[i].stat & STAT_NOPRINT) &&
             !(jobtab[i].stat & STAT_STOPPED)) {
-            if (jobtab[i].gleader != getpid() &&
-		killpg(jobtab[i].gleader, SIGHUP) != -1)
+            if (killpg(jobtab[i].gleader, SIGHUP) != -1)
                 killed++;
         }
     if (killed)