timesyncd: make use of floating event sources for signal handling
authorLennart Poettering <lennart@poettering.net>
Sat, 17 May 2014 19:13:10 +0000 (21:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 18 May 2014 11:52:49 +0000 (20:52 +0900)
src/timesync/timesyncd.c
src/timesync/timesyncd.h

index 2184336..19e6d67 100644 (file)
@@ -978,8 +978,8 @@ static int manager_new(Manager **ret) {
 
         sd_event_set_watchdog(m->event, true);
 
-        sd_event_add_signal(m->event, &m->sigterm, SIGTERM, NULL,  NULL);
-        sd_event_add_signal(m->event, &m->sigint, SIGINT, NULL, NULL);
+        sd_event_add_signal(m->event, NULL, SIGTERM, NULL,  NULL);
+        sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL);
 
         r = sd_resolve_default(&m->resolve);
         if (r < 0)
@@ -1006,9 +1006,6 @@ static void manager_free(Manager *m) {
         manager_disconnect(m);
         manager_flush_names(m);
 
-        sd_event_source_unref(m->sigint);
-        sd_event_source_unref(m->sigterm);
-
         sd_event_source_unref(m->event_retry);
 
         sd_event_source_unref(m->network_event_source);
index 370b966..471d4b0 100644 (file)
@@ -92,9 +92,6 @@ struct Manager {
 
         /* Retry connections */
         sd_event_source *event_retry;
-
-        /* Handle SIGINT/SIGTERM */
-        sd_event_source *sigterm, *sigint;
 };
 
 const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, unsigned length);