diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/localed/localed.c | 8 | ||||
-rw-r--r-- | src/interfaces/logind/logind.c | 8 | ||||
-rw-r--r-- | src/interfaces/timedated/timedated.c | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/interfaces/localed/localed.c b/src/interfaces/localed/localed.c index 83c8de2..27448ac 100644 --- a/src/interfaces/localed/localed.c +++ b/src/interfaces/localed/localed.c @@ -142,6 +142,14 @@ gboolean unix_sig_terminate_handler(gpointer data) { return G_SOURCE_REMOVE; } +void set_signal_handlers() { + + /* we don't care about its descriptor, we never need to unregister these */ + g_unix_signal_add(SIGINT, unix_sig_terminate_handler, NULL); + g_unix_signal_add(SIGHUP, unix_sig_terminate_handler, NULL); + g_unix_signal_add(SIGTERM, unix_sig_terminate_handler, NULL); +} + int main() { localed_loop = g_main_loop_new(NULL, TRUE); diff --git a/src/interfaces/logind/logind.c b/src/interfaces/logind/logind.c index a0b0343..da9e24b 100644 --- a/src/interfaces/logind/logind.c +++ b/src/interfaces/logind/logind.c @@ -142,6 +142,14 @@ gboolean unix_sig_terminate_handler(gpointer data) { return G_SOURCE_REMOVE; } +void set_signal_handlers() { + + /* we don't care about its descriptor, we never need to unregister these */ + g_unix_signal_add(SIGINT, unix_sig_terminate_handler, NULL); + g_unix_signal_add(SIGHUP, unix_sig_terminate_handler, NULL); + g_unix_signal_add(SIGTERM, unix_sig_terminate_handler, NULL); +} + int main() { logind_loop = g_main_loop_new(NULL, TRUE); diff --git a/src/interfaces/timedated/timedated.c b/src/interfaces/timedated/timedated.c index 265a33f..32f040a 100644 --- a/src/interfaces/timedated/timedated.c +++ b/src/interfaces/timedated/timedated.c @@ -142,6 +142,14 @@ gboolean unix_sig_terminate_handler(gpointer data) { return G_SOURCE_REMOVE; } +void set_signal_handlers() { + + /* we don't care about its descriptor, we never need to unregister these */ + g_unix_signal_add(SIGINT, unix_sig_terminate_handler, NULL); + g_unix_signal_add(SIGHUP, unix_sig_terminate_handler, NULL); + g_unix_signal_add(SIGTERM, unix_sig_terminate_handler, NULL); +} + int main() { timedated_loop = g_main_loop_new(NULL, TRUE); |