Avoid using non signal-aync-safety on signal handler as a common 61/186261/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20180814.174858 accepted/tizen/4.0/unified/20180904.174106 submit/tizen_4.0/20180809.062717 submit/tizen_4.0/20180903.052402
authorSeungbae Shin <seungbae.shin@samsung.com>
Wed, 8 Aug 2018 10:47:47 +0000 (19:47 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 8 Aug 2018 10:49:02 +0000 (19:49 +0900)
[Version] 0.2.20
[Issue Type] Dotnet

Change-Id: Id999d039f11a907c5dd5858e2c6d2a1ba89369c2

mm_session.c
mm_session.h
packaging/libmm-session.spec

index 6d2c86d..915982e 100644 (file)
@@ -36,9 +36,7 @@
 #define MAX_FILE_LENGTH 256
 
 int g_session_type = -1;
-#ifdef TIZEN_TV
 static char g_filename[64];
-#endif
 
 struct sigaction session_int_old_action;
 struct sigaction session_abrt_old_action;
@@ -389,19 +387,11 @@ void __session_signal_handler(int signo, siginfo_t *siginfo, void *context)
 {
        sigset_t old_mask, all_mask;
 
-#ifndef TIZEN_TV
-       debug_warning("ENTER, signo(%d), siginfo(%p), context(%p)", signo, siginfo, context);
-#endif
-
        /* signal block -------------- */
        sigfillset(&all_mask);
        sigprocmask(SIG_BLOCK, &all_mask, &old_mask);
 
-#ifndef TIZEN_TV
-       _mm_session_util_delete_information(-1);
-#else
        unlink(g_filename);
-#endif
 
        sigprocmask(SIG_SETMASK, &old_mask, NULL);
        /* signal unblock ------------ */
@@ -446,13 +436,8 @@ void __session_signal_handler(int signo, siginfo_t *siginfo, void *context)
        default:
                break;
        }
-
-#ifndef TIZEN_TV
-       debug_warning("LEAVE");
-#endif
 }
 
-#ifdef TIZEN_TV
 EXPORT_API
 void mm_session_dotnet_cleanup(int signo)
 {
@@ -468,7 +453,6 @@ static bool _is_dotnet_app(void)
        else
                return false;
 }
-#endif
 
 static void _mm_session_util_clear_information(void)
 {
@@ -494,13 +478,11 @@ void __mmsession_initialize(void)
 
        _mm_session_util_clear_information();
 
-#ifdef TIZEN_TV
        if (_is_dotnet_app()) {
                debug_warning("no signal handler for dotnet!!");
                snprintf(g_filename, sizeof(g_filename)-1, "/tmp/mm-session/mm_session_%d", getpid());
                return;
        }
-#endif
        session_action.sa_sigaction = __session_signal_handler;
        session_action.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
 
@@ -523,12 +505,12 @@ void __mmsession_finalize(void)
        debug_fenter();
 
        _mm_session_util_delete_information(-1);
-#ifdef TIZEN_TV
+
        if (_is_dotnet_app()) {
                debug_warning("no signal handler for dotnet!!");
                return;
        }
-#endif
+
        sigaction(SIGINT, &session_int_old_action, NULL);
        sigaction(SIGABRT, &session_abrt_old_action, NULL);
        sigaction(SIGSEGV, &session_segv_old_action, NULL);
index 3292397..7721fba 100644 (file)
@@ -230,9 +230,7 @@ int mm_session_get_current_information(int *session_type, int *session_options);
  */
 int mm_session_update_option(session_update_type_t update_type, int options);
 
-#ifdef TIZEN_TV
 void mm_session_dotnet_cleanup(int signo);
-#endif
 
 /**
        @}
index 96696a3..c0f76cb 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-session
 Summary:    Multimedia Session Library
-Version:    0.2.19
+Version:    0.2.20
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0