From: Hwankyu Jhun Date: Sun, 5 Aug 2018 22:46:50 +0000 (+0900) Subject: Use strerror_r function X-Git-Tag: accepted/tizen/unified/20180823.072107~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F185955%2F2;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Use strerror_r function Change-Id: Icd59265066036fc0b4a5417e882ecb57920ab1e9 Signed-off-by: Hwankyu Jhun --- 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)