pty: unblock all signals before exec'ing the child
authorRan Benita <ran234@gmail.com>
Mon, 23 Jan 2012 16:16:09 +0000 (18:16 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 28 Jan 2012 11:54:22 +0000 (12:54 +0100)
commitd480ec103017cb592ce28e896483042b6f58086b
tree86b87e575169c6802cbb25c09cf4caea0fc9e5a0
parentbeb430183035c3803f6cbd824effa2bf2350728c
pty: unblock all signals before exec'ing the child

When we register signals in the eloop we also block them in our signal
mask. The signal mask is inherited by the child. Therefore, if the child
does not reset its mask (e.g. bash and most normal processes), it will
not receive any of the signals that we handle. So for example C-c
(SIGINT) does nothing in the child process.

We now unblock all signals before we exec the child.

It's also worth noting that if we _ignore_ a signal -
sigaction(SIG_IGN) - this is also inherited and we must reset it to
default. However, we do not ignore signals so this is unneeded.

Here is some more discussion on signalfd and this problem:
https://lwn.net/Articles/415684/

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/pty.c