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
This commit is contained in:
Jilles Tjoelker 2015-04-25 13:34:25 +00:00
parent da551bb2c2
commit cad3cc1310
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281982

View File

@ -1057,7 +1057,7 @@ waitforjob(struct job *jp, int *origstatus)
CLEAR_PENDING_INT; CLEAR_PENDING_INT;
} }
#if JOBS #if JOBS
else if (rootshell && iflag && propagate_int && else if (rootshell && propagate_int &&
WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
kill(getpid(), SIGINT); kill(getpid(), SIGINT);
#endif #endif