Fix setting AUL environment variables 32/176432/3
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 19 Apr 2018 07:22:05 +0000 (16:22 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Thu, 19 Apr 2018 23:37:24 +0000 (23:37 +0000)
- Removes deleting the environment variables

Change-Id: Id4329a4702e4f70d4437b606816ba4f5a840d8de
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/pkginfo.c

index c6d7acc..0f20b27 100644 (file)
@@ -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;
 }