Fix TIZEN_FEATURE_DEBUG_MODE 49/222049/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 9 Jan 2020 08:33:06 +0000 (17:33 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 9 Jan 2020 08:33:06 +0000 (17:33 +0900)
If the prelink feature is enabled, the debug feature is disabled.

Change-Id: I375f1c76b6cdd3860d35781960dc0736caacc791
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
packaging/aul.spec
src/aul_unix_signal.c

index a3427e7..cd62293 100755 (executable)
@@ -63,12 +63,6 @@ Application utility library (test tools)
 %define tizen_feature_prelink 0
 %endif
 
-%if "%{?tizen_build_devel_mode}" == "1"
-%define tizen_debug_mode 1
-%else
-%define tizen_debug_mode 0
-%endif
-
 %prep
 %setup -q
 sed -i 's|TZ_SYS_DB|%{TZ_SYS_DB}|g' %{SOURCE1001}
@@ -81,9 +75,7 @@ CFLAGS="%{optflags} -D__emul__"; export CFLAGS
 
 %if 0%{?tizen_feature_prelink}
 _TIZEN_FEATURE_PRELINK=ON
-%endif
-
-%if 0%{?tizen_debug_mode}
+%else
 _TIZEN_FEATURE_DEBUG_MODE=ON
 %endif
 
index 670a34f..ae31ef1 100644 (file)
 
 #define _GNU_SOURCE
 
+#include <dlfcn.h>
+#include <execinfo.h>
 #include <signal.h>
 #include <stdio.h>
 
 #include "aul_unix_signal.h"
 #include "aul_util.h"
 
-#ifdef TIZEN_FEATURE_DEBUG_MODE
-#include <dlfcn.h>
-#include <execinfo.h>
-
 #define BT_BUF_SIZE 128
 
 #define PRINT_BACKTRACE() do {                                                 \
@@ -58,7 +56,8 @@
                 }                                                              \
         }                                                                      \
 } while (0)
-#endif /* TIZEN_FEATURE_DEBUG_MODE */
+
+#if TIZEN_FEATURE_DEBUG_MODE
 
 typedef enum {
        AUL_SIGHUP,
@@ -147,9 +146,7 @@ static void __aul_unix_signal_handler(int signo, siginfo_t *info, void *arg)
        _E("[__SIGNAL__] signal: %d(%s)",
                        signo, __get_aul_signo_string(__get_aul_signo(signo)));
 
-#ifdef TIZEN_FEATURE_DEBUG_MODE
        PRINT_BACKTRACE();
-#endif /* TIZEN_FEATURE_DEBUG_MODE */
 
        if (__callback)
                __callback(signo, __user_data);
@@ -160,18 +157,22 @@ static void __aul_unix_signal_handler(int signo, siginfo_t *info, void *arg)
                raise(signo);
        }
 }
+#endif /* TIZEN_FEATURE_DEBUG_MODE */
 
 int aul_unix_signal_set_event_cb(aul_unix_signal_cb callback,
                void *user_data)
 {
+#if TIZEN_FEATURE_DEBUG_MODE
        __callback = callback;
        __user_data = user_data;
+#endif /* TIZEN_FEATURE_DEBUG_MODE */
 
        return 0;
 }
 
 int aul_unix_signal_init(void)
 {
+#if TIZEN_FEATURE_DEBUG_MODE
        struct sigaction action = { 0, };
        int signo;
        int i;
@@ -185,12 +186,14 @@ int aul_unix_signal_init(void)
                if (signo != -1)
                        sigaction(signo, &action, &__old_action[i]);
        }
+#endif /* TIZEN_FEATURE_DEBUG_MODE */
 
        return 0;
 }
 
 void aul_unix_signal_fini(void)
 {
+#if TIZEN_FEATURE_DEBUG_MODE
        int signo;
        int i;
 
@@ -201,4 +204,5 @@ void aul_unix_signal_fini(void)
                if (signo != -1)
                        sigaction(signo, &__old_action[i], NULL);
        }
+#endif /* TIZEN_FEATURE_DEBUG_MODE */
 }