aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-01 20:13:37 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-01 20:13:37 +0000
commit2544e93c0e47f52362f6ce6945d7bf17d0b37e24 (patch)
tree0f72cc86b04b5e3ac0e9429f386d227151b79406 /client.c
parentclient/server: add -t,--term to footclient (diff)
client: register signal handler for SIGTERM too
Diffstat (limited to 'client.c')
-rw-r--r--client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/client.c b/client.c
index bac72838..6b36a4bb 100644
--- a/client.c
+++ b/client.c
@@ -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;
}