Do not raise() inside signal handler 93/144893/3 accepted/tizen/unified/20170822.023847 submit/tizen/20170821.085338
authorSeungbae Shin <seungbae.shin@samsung.com>
Fri, 18 Aug 2017 08:05:02 +0000 (17:05 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 21 Aug 2017 07:40:32 +0000 (16:40 +0900)
[Version] 0.11.19
[Issue Type] Cleanup

Change-Id: I17e3d04d75b54bdec9a29aa45575f32e0de89903

mm_sound_client.c
packaging/libmm-sound.spec

index 0c626ac..c8eaa11 100644 (file)
@@ -146,7 +146,7 @@ typedef struct _focus_idle_event {
        int data;
 } focus_idle_event_t;
 
-void _system_signal_handler(int signo)
+void _system_signal_handler(int signo, siginfo_t *siginfo, void *context)
 {
        int ret = MM_ERROR_NONE;
        sigset_t old_mask, all_mask;
@@ -171,28 +171,40 @@ void _system_signal_handler(int signo)
 
        switch (signo) {
        case SIGINT:
-               sigaction(SIGINT, &system_int_old_action, NULL);
-               raise( signo);
+               if (system_int_old_action.sa_sigaction)
+                       system_int_old_action.sa_sigaction(signo, siginfo, context);
+               else
+                       sigaction(signo, &system_int_old_action, NULL);
                break;
        case SIGABRT:
-               sigaction(SIGABRT, &system_abrt_old_action, NULL);
-               raise( signo);
+               if (system_abrt_old_action.sa_sigaction)
+                       system_abrt_old_action.sa_sigaction(signo, siginfo, context);
+               else
+                       sigaction(signo, &system_abrt_old_action, NULL);
                break;
        case SIGSEGV:
-               sigaction(SIGSEGV, &system_segv_old_action, NULL);
-               raise( signo);
+               if (system_segv_old_action.sa_sigaction)
+                       system_segv_old_action.sa_sigaction(signo, siginfo, context);
+               else
+                       sigaction(signo, &system_segv_old_action, NULL);
                break;
        case SIGTERM:
-               sigaction(SIGTERM, &system_term_old_action, NULL);
-               raise( signo);
+               if (system_term_old_action.sa_sigaction)
+                       system_term_old_action.sa_sigaction(signo, siginfo, context);
+               else
+                       sigaction(signo, &system_term_old_action, NULL);
                break;
        case SIGSYS:
-               sigaction(SIGSYS, &system_sys_old_action, NULL);
-               raise( signo);
+               if (system_sys_old_action.sa_sigaction)
+                       system_sys_old_action.sa_sigaction(signo, siginfo, context);
+               else
+                       sigaction(signo, &system_sys_old_action, NULL);
                break;
        case SIGXCPU:
-               sigaction(SIGXCPU, &system_xcpu_old_action, NULL);
-               raise( signo);
+               if (system_xcpu_old_action.sa_sigaction)
+                       system_xcpu_old_action.sa_sigaction(signo, siginfo, context);
+               else
+                       sigaction(signo, &system_xcpu_old_action, NULL);
                break;
        default:
                break;
@@ -212,7 +224,7 @@ int mm_sound_client_initialize(void)
 
        struct sigaction system_action;
        system_action.sa_handler = _system_signal_handler;
-       system_action.sa_flags = SA_NOCLDSTOP;
+       system_action.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
 
        sigemptyset(&system_action.sa_mask);
 
index 2744c54..77a49d7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.11.18
+Version:    0.11.19
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0