If signal-handlers are set to SIG_IGN, then this behavior is preserved
across an execve(). We don't want that so reset the handlers for all
childs before executing them.
kmscon may be executed with pre-set signal handlers for good reasons. So
reset the handlers in setup_child() so we have a clean environment.
This fixes a bug where child-programs assume SIGPIPE is not ignored but do
not explicitly set it to SIG_DFL.
Reported-by: Swift Geek [github issue #62]
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
sigset_t sigset;
pid_t pid;
char slave_name[128];
- int slave = -1;
+ int slave = -1, i;
struct termios attr;
/* The child should not inherit our signal mask. */
if (ret)
log_warn("cannot reset blocked signals: %m");
+ for (i = 1; i < SIGUNUSED; ++i)
+ signal(i, SIG_DFL);
+
ret = grantpt(master);
if (ret < 0) {
log_err("grantpt failed: %m");