diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 14566fc43..722ea197e 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -8,9 +8,6 @@ #include "sway/config.h" #include "sway/server.h" #include "sway/desktop/launcher.h" -#include "sway/tree/container.h" -#include "sway/tree/root.h" -#include "sway/tree/workspace.h" #include "log.h" #include "stringop.h" diff --git a/sway/main.c b/sway/main.c index 0cc7623d8..16efb84bf 100644 --- a/sway/main.c +++ b/sway/main.c @@ -330,9 +330,14 @@ int main(int argc, char **argv) { increase_nofile_limit(); // handle SIGTERM signals - signal(SIGTERM, sig_handler); - signal(SIGINT, sig_handler); - signal(SIGCHLD, sigchld_handler); + struct sigaction sa; + sa.sa_handler = sigchld_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART | SA_NOCLDSTOP; + sigaction(SIGCHLD, &sa, NULL); + sa.sa_handler = sig_handler; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); // prevent ipc from crashing sway signal(SIGPIPE, SIG_IGN);