From ced33358fcbeb9e469927a63c33d73acc1db5c32 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 31 Aug 1999 13:55:45 +0000 Subject: zsh-workers/7573 --- Src/exec.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 97e8f4912..2fb3b5e9b 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1760,6 +1760,13 @@ 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 && -- cgit 1.4.1