diff options
-rw-r--r-- | bin/sh/jobs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index d42848f..29939d1 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -866,6 +866,7 @@ waitforjob(struct job *jp, int *origstatus) { #if JOBS pid_t mypgrp = getpgrp(); + int propagate_int = jp->jobctl && jp->foreground; #endif int status; int st; @@ -903,6 +904,11 @@ waitforjob(struct job *jp, int *origstatus) else CLEAR_PENDING_INT; } +#if JOBS + else if (rootshell && iflag && propagate_int && + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) + kill(getpid(), SIGINT); +#endif INTON; return st; } |