summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2018-04-19 16:22:05 +0900
committerHwanKyu Jhun <h.jhun@samsung.com>2018-04-19 23:37:24 +0000
commit74b03e07f213f5bb20e6192167674e3372960274 (patch)
tree758d18afa5a5c585867d10bea5ee1f5bb61849aa
parent528dfb9f0f349ebe06a67a1a70f33b02b274babe (diff)
downloadaul-1-74b03e07f213f5bb20e6192167674e3372960274.tar.gz
aul-1-74b03e07f213f5bb20e6192167674e3372960274.tar.bz2
aul-1-74b03e07f213f5bb20e6192167674e3372960274.zip
Fix setting AUL environment variables
- Removes deleting the environment variables Change-Id: Id4329a4702e4f70d4437b606816ba4f5a840d8de Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--src/pkginfo.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/pkginfo.c b/src/pkginfo.c
index c6d7acca..0f20b275 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;
}