client: register signal handler for SIGTERM too

This commit is contained in:
Daniel Eklöf 2019-11-01 21:13:37 +01:00
parent 438d6eaff0
commit 2544e93c0e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -130,7 +130,8 @@ main(int argc, char *const *argv)
}
}
if (sigaction(SIGINT, &(struct sigaction){.sa_handler = &sig_handler}, NULL) < 0) {
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");
goto err;
}