about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-01 12:15:24 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-01 12:15:24 +0000
commit3334b38905019c6eccef7e97a08ea1803ca23c31 (patch)
tree7f7261d087ea6cff38dbe68e62a829665775ccd4 /Src
parentf25a524da526b843c73e9febcf6987c35a8dec74 (diff)
downloadzsh-3334b38905019c6eccef7e97a08ea1803ca23c31.tar.gz
zsh-3334b38905019c6eccef7e97a08ea1803ca23c31.tar.xz
zsh-3334b38905019c6eccef7e97a08ea1803ca23c31.zip
zsh-workers/7605
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c9
-rw-r--r--Src/jobs.c3
2 files changed, 2 insertions, 10 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 27f964430..720620e71 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1760,13 +1760,6 @@ execcmd(Cmd cmd, int input, int output, int how, int last1)
 #ifdef PATH_DEV_FD
 	    closem(2);
 #endif
-
-	    /* If there is already a group leader but that has died, we make
-	     * this one the leader. */
-	    if (pline_level == 1 && jobtab[thisjob].procs &&
-		kill(jobtab[thisjob].gleader, 0) == -1)
-		jobtab[thisjob].gleader = pid;
-
 	    if (how & Z_ASYNC) {
 		lastpid = (zlong) pid;
 	    } else if (!jobtab[thisjob].stty_in_env &&
@@ -2243,7 +2236,7 @@ entersubsh(int how, int cl, int fake)
 	}
     } else if (thisjob != -1 && cl) {
 	if (jobtab[list_pipe_job].gleader && (list_pipe || list_pipe_child)) {
-	    if (kill(jobtab[list_pipe_job].gleader, 0) == -1 ||
+	    if (killpg(jobtab[list_pipe_job].gleader, 0) == -1 ||
 		setpgrp(0L, jobtab[list_pipe_job].gleader) == -1) {
 		jobtab[list_pipe_job].gleader =
 		    jobtab[thisjob].gleader = (list_pipe_child ? mypgrp : getpid());
diff --git a/Src/jobs.c b/Src/jobs.c
index fdf69a960..7b060cd87 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1292,8 +1292,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 		    thisjob = job;
 		    if ((jobtab[job].stat & STAT_SUPERJOB) &&
 			((!jobtab[job].procs->next ||
-			  WIFEXITED(jobtab[job].procs->status) ||
-			  WIFSIGNALED(jobtab[job].procs->status))) &&
+			  killpg(jobtab[job].gleader, 0) == -1)) &&
 			jobtab[jobtab[job].other].gleader)
 			attachtty(jobtab[jobtab[job].other].gleader);
 		    else