Comment 2 for bug 1064726

Revision history for this message
Thorsten Glaser (mirabilos) wrote : Re: maybe cater to broken programs doing weird things with SIGINT

Another one, from jilles:

mksh -c 'trap ":" INT; sleep 10; echo $?'

Interrupting (^C) that prints 0 with recent mksh, as long as sleep is the mksh builtin (even using /bin/sleep on MirBSD lets it print 0, whereas using /bin/sleep on FreeBSD or Debian, where it’s not the mksh builtin, prints 130).

This may or may not be related. My guess here is that the sleep builtin gets SIGINT but doesn’t kill itself which leads to the parent not seeing the signal. (Not getting it is also not nice, as that wouldn’t kill the sleep then.)