Use strerror_r function 55/185955/2
authorHwankyu Jhun <h.jhun@samsung.com>
Sun, 5 Aug 2018 22:46:50 +0000 (07:46 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Sun, 5 Aug 2018 22:52:19 +0000 (22:52 +0000)
Change-Id: Icd59265066036fc0b4a5417e882ecb57920ab1e9
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad_common.c

index f8a9a3b..df893cd 100644 (file)
@@ -678,6 +678,21 @@ error:
        return -1;
 }
 
+#ifdef TIZEN_FEATURE_SET_PERSONALITY_32
+static void __set_execution_domain(void)
+{
+       char err_buf[1024];
+       int res;
+
+       res = personality(PER_LINUX32);
+       if (res < 0) {
+               _E("personality() failed,  error: %d (%s)",
+                               errno,
+                               strerror_r(errno, err_buf, sizeof(err_buf)));
+       }
+}
+#endif /* TIZEN_FEATURE_SET_PERSONALITY_32 */
+
 void _set_env(appinfo_t *menu_info, bundle *kb)
 {
        const char *str;
@@ -716,13 +731,8 @@ void _set_env(appinfo_t *menu_info, bundle *kb)
        setenv("AUL_PID", buf, 1);
 
 #ifdef TIZEN_FEATURE_SET_PERSONALITY_32
-       int res = personality(PER_LINUX32);
-
-       if (res < 0) {
-               _E("personality() failed,  error: %d (%s)",
-                               errno, strerror(errno));
-       }
-#endif
+       __set_execution_domain();
+#endif /* TIZEN_FEATURE_SET_PERSONALITY_32 */
 }
 
 char **_create_argc_argv(bundle *kb, int *margc)