Disable signal hander in focus-server 90/105490/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Sat, 17 Dec 2016 08:00:09 +0000 (17:00 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Sat, 17 Dec 2016 08:00:09 +0000 (17:00 +0900)
[Version] 0.10.71
[Profile] Common
[Issue Type] KONA

Change-Id: I92f448941d102bd8b3dedd9e561a4b6586843444

focus_server/mm_sound_focus_server.c

index 5fbba1a..1080d4e 100644 (file)
@@ -35,6 +35,8 @@
 #include <lwipc.h>
 #endif
 
+#include <signal.h>
+
 #include "../include/mm_sound_common.h"
 #include "include/mm_sound_mgr_focus.h"
 #include "include/mm_sound_mgr_focus_dbus.h"
@@ -50,13 +52,6 @@ typedef struct {
 static int _get_option(int argc, char **argv, server_arg *arg);
 static int _usage(int argc, char **argv);
 
-static struct sigaction sigint_action;  /* Backup pointer of SIGINT handler */
-static struct sigaction sigabrt_action; /* Backup pointer of SIGABRT signal handler */
-static struct sigaction sigsegv_action; /* Backup pointer of SIGSEGV fault signal handler */
-static struct sigaction sigterm_action; /* Backup pointer of SIGTERM signal handler */
-static struct sigaction sigsys_action;  /* Backup pointer of SIGSYS signal handler */
-static void _exit_handler(int sig);
-
 GMainLoop *g_mainloop;
 
 static void _mainloop_run()
@@ -119,36 +114,6 @@ static int _get_option(int argc, char **argv, server_arg *arg)
        return 0;
 }
 
-//__attribute__ ((destructor))
-static void _exit_handler(int sig)
-{
-       switch (sig) {
-       case SIGINT:
-               sigaction(SIGINT, &sigint_action, NULL);
-               debug_error("signal(SIGINT) error");
-               break;
-       case SIGABRT:
-               sigaction(SIGABRT, &sigabrt_action, NULL);
-               debug_error("signal(SIGABRT) error");
-               break;
-       case SIGSEGV:
-               sigaction(SIGSEGV, &sigsegv_action, NULL);
-               debug_error("signal(SIGSEGV) error");
-               break;
-       case SIGTERM:
-               sigaction(SIGTERM, &sigterm_action, NULL);
-               debug_error("signal(SIGTERM) error");
-               break;
-       case SIGSYS:
-               sigaction(SIGSYS, &sigsys_action, NULL);
-               debug_error("signal(SIGSYS) error");
-               break;
-       default:
-               break;
-       }
-       raise(sig);
-}
-
 static int _usage(int argc, char **argv)
 {
        fprintf(stderr, "Usage: %s [Options]\n", argv[0]);
@@ -162,7 +127,6 @@ int main(int argc, char **argv)
 {
        sem_t* sem = NULL;
        server_arg serveropt;
-       struct sigaction action;
 #if !defined(USE_SYSTEM_SERVER_PROCESS_MONITORING)
        int pid;
 #endif
@@ -170,10 +134,6 @@ int main(int argc, char **argv)
        int fd_ss_ready = -1;
 #endif
 
-       action.sa_handler = _exit_handler;
-       action.sa_flags = 0;
-       sigemptyset(&action.sa_mask);
-
        if (_get_option(argc, argv, &serveropt))
                return 1;
 
@@ -208,11 +168,6 @@ int main(int argc, char **argv)
                }
        }
 #endif
-       sigaction(SIGABRT, &action, &sigabrt_action);
-       sigaction(SIGSEGV, &action, &sigsegv_action);
-       sigaction(SIGTERM, &action, &sigterm_action);
-       sigaction(SIGSYS, &action, &sigsys_action);
-
        if (serveropt.startserver) {
                MMSoundMgrFocusDbusInit();
                MMSoundMgrFocusInit();