From: Hwankyu Jhun Date: Thu, 19 Apr 2018 07:22:05 +0000 (+0900) Subject: Fix setting AUL environment variables X-Git-Tag: accepted/tizen/unified/20180420.081912~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74b03e07f213f5bb20e6192167674e3372960274;p=platform%2Fcore%2Fappfw%2Faul-1.git Fix setting AUL environment variables - Removes deleting the environment variables Change-Id: Id4329a4702e4f70d4437b606816ba4f5a840d8de Signed-off-by: Hwankyu Jhun --- diff --git a/src/pkginfo.c b/src/pkginfo.c index c6d7acc..0f20b27 100644 --- a/src/pkginfo.c +++ b/src/pkginfo.c @@ -33,9 +33,9 @@ typedef struct _internal_param_t { void *user_data; } internal_param_t; -static const char *__appid = NULL; -static const char *__pkgid = NULL; -static const char *__root_path = NULL; +static const char *__appid; +static const char *__pkgid; +static const char *__root_path; API int aul_app_get_pid(const char *appid) { @@ -220,14 +220,8 @@ API void aul_set_preinit_appid(const char *appid) const char *__get_preinit_appid(void) { - const char *appid; - - appid = getenv("AUL_APPID"); - if (appid) { - if (__appid == NULL) - __appid = strdup(appid); - unsetenv("AUL_APPID"); - } + if (!__appid) + __appid = getenv("AUL_APPID"); return __appid; } @@ -239,14 +233,8 @@ API void aul_set_preinit_pkgid(const char *pkgid) const char *__get_preinit_pkgid(void) { - const char *pkgid; - - pkgid = getenv("AUL_PKGID"); - if (pkgid) { - if (__pkgid == NULL) - __pkgid = strdup(pkgid); - unsetenv("AUL_PKGID"); - } + if (!__pkgid) + __pkgid = getenv("AUL_PKGID"); return __pkgid; } @@ -258,14 +246,8 @@ API void aul_set_preinit_root_path(const char *root_path) API const char *aul_get_preinit_root_path(void) { - const char *root_path; - - root_path = getenv("AUL_ROOT_PATH"); - if (root_path) { - if (__root_path == NULL) - __root_path = strdup(root_path); - unsetenv("AUL_ROOT_PATH"); - } + if (!__root_path) + __root_path = getenv("AUL_ROOT_PATH"); return __root_path; }