slave: restore signals before calling exec()

This commit is contained in:
Daniel Eklöf 2019-11-03 13:24:15 +01:00
parent d26c67e589
commit 61dfa1365e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 14 additions and 1 deletions

1
main.c
View file

@ -205,6 +205,7 @@ main(int argc, char *const *argv)
if (as_server && (server = server_init(&conf, fdm, wayl)) == NULL)
goto out;
/* Remember to restore signals in slave */
const struct sigaction sa = {.sa_handler = &sig_handler};
if (sigaction(SIGINT, &sa, NULL) < 0 || sigaction(SIGTERM, &sa, NULL) < 0) {
LOG_ERRNO("failed to register signal handlers");