From 3334b38905019c6eccef7e97a08ea1803ca23c31 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 1 Sep 1999 12:15:24 +0000 Subject: zsh-workers/7605 --- Src/exec.c | 9 +-------- Src/jobs.c | 3 +-- 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 -- cgit 1.4.1