From c47ddfd852125550e69f39fc6c110821bcb6b8e7 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 8 Dec 2011 10:44:56 +0200 Subject: [PATCH] compositor: reset signal mask for children The signal mask is inherited over fork() and exec(), we need to explicitly reset it. This allows the children to receive the signals the compositor itself has blocked, for example SIGINT and SIGTERM. Signed-off-by: Pekka Paalanen --- compositor/compositor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compositor/compositor.c b/compositor/compositor.c index 79440fdf..30cc7ab2 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -90,6 +90,11 @@ child_client_exec(int sockfd, const char *path) { int flags; char s[32]; + sigset_t allsigs; + + /* do not give our signal mask to the new process */ + sigfillset(&allsigs); + sigprocmask(SIG_UNBLOCK, &allsigs, NULL); /* SOCK_CLOEXEC closes both ends, so we need to unset * the flag on the client fd. */