CTRL-C caused the weston process to exit
[platform/core/system/tlm.git] / src / sessiond / main.c
index a8ab109..bf5ed9d 100644 (file)
@@ -28,7 +28,6 @@
 #include <signal.h>
 #include <string.h>
 #include <stdio.h>
-#include <errno.h>
 #include <glib-unix.h>
 #include <glib.h>
 #include <gio/gio.h>
@@ -38,7 +37,7 @@
 #include "tlm-session-daemon.h"
 
 static TlmSessionDaemon *_daemon = NULL;
-static guint _sig_source_id[2];
+static guint _sig_source_id[3];
 
 static void
 _on_daemon_closed (gpointer data, GObject *server)
@@ -66,9 +65,6 @@ _install_sighandlers (GMainLoop *main_loop)
     GSource *source = NULL;
     GMainContext *ctx = g_main_loop_get_context (main_loop);
 
-    if (signal (SIGINT, SIG_IGN) == SIG_ERR)
-        WARN ("failed to ignore SIGINT: %s", strerror(errno));
-
     source = g_unix_signal_source_new (SIGTERM);
     g_source_set_callback (source,
                            _handle_quit_signal,
@@ -76,13 +72,20 @@ _install_sighandlers (GMainLoop *main_loop)
                            NULL);
     _sig_source_id[0] = g_source_attach (source, ctx);
 
-    source = g_unix_signal_source_new (SIGHUP);
+    source = g_unix_signal_source_new (SIGINT);
     g_source_set_callback (source,
                            _handle_quit_signal,
                            main_loop,
                            NULL);
     _sig_source_id[1] = g_source_attach (source, ctx);
 
+    source = g_unix_signal_source_new (SIGHUP);
+    g_source_set_callback (source,
+                           _handle_quit_signal,
+                           main_loop,
+                           NULL);
+    _sig_source_id[2] = g_source_attach (source, ctx);
+
     if (prctl(PR_SET_PDEATHSIG, SIGHUP))
         WARN ("failed to set parent death signal");
 }