diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-27 05:31:53 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-27 05:31:53 +0100 |
commit | 6632c6023c5f90e15440231500d3431e869e4577 (patch) | |
tree | 2b6466c7183b3d005e1fe20453ab8c2213099538 | |
parent | 2da3263ab6eed1780b000c09884ba9bf006c4891 (diff) |
trap some signals
-rw-r--r-- | manager.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -44,6 +44,9 @@ Manager* manager_new(void) { assert_se(sigemptyset(&mask) == 0); assert_se(sigaddset(&mask, SIGCHLD) == 0); assert_se(sigaddset(&mask, SIGINT) == 0); + assert_se(sigaddset(&mask, SIGTERM) == 0); + assert_se(sigaddset(&mask, SIGWINCH) == 0); + assert_se(sigaddset(&mask, SIGHUP) == 0); assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); m->signal_watch.type = WATCH_SIGNAL_FD; @@ -1004,8 +1007,12 @@ static int manager_process_signal_fd(Manager *m, bool *quit) { break; case SIGINT: + case SIGTERM: *quit = true; return 0; + + default: + log_info("Got unhandled signal <%s>.", strsignal(sfsi.ssi_signo)); } } |