From 5b6f99d7ec6bc3a179294951197d214fa689ae76 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 6 Aug 2018 07:46:50 +0900 Subject: [PATCH] Use strerror_r function Change-Id: Icd59265066036fc0b4a5417e882ecb57920ab1e9 Signed-off-by: Hwankyu Jhun --- src/launchpad_common.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/launchpad_common.c b/src/launchpad_common.c index f8a9a3b..df893cd 100644 --- a/src/launchpad_common.c +++ b/src/launchpad_common.c @@ -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) -- 2.7.4