]> err.no Git - systemd/commitdiff
trap some signals
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Jan 2010 04:31:53 +0000 (05:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Jan 2010 04:31:53 +0000 (05:31 +0100)
manager.c

index a598f1241d52fc003732feeab10772414f68d940..b3123f2b1d2d57ac29f02b55acac9cec704a42af 100644 (file)
--- a/manager.c
+++ b/manager.c
@@ -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));
                 }
         }