From cad3cc1310cdc692c4261e36f5978bbbbcefd16b Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 25 Apr 2015 13:34:25 +0000 Subject: [PATCH] sh: Pass along SIGINT from a child if job control is enabled, even when not interactive. I added the interactive check in r208881 to be safe, but in actual use (scripts in set -m mode) passing along SIGINT seems best. Discussed with: bdrewery --- bin/sh/jobs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index 753cf7bd931f..b531231e4a59 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -1057,7 +1057,7 @@ waitforjob(struct job *jp, int *origstatus) CLEAR_PENDING_INT; } #if JOBS - else if (rootshell && iflag && propagate_int && + else if (rootshell && propagate_int && WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) kill(getpid(), SIGINT); #endif