Add missing path to resolving ug library 39/62439/1 accepted/tizen/common/20160316.160657 accepted/tizen/ivi/20160316.082008 accepted/tizen/mobile/20160316.081919 accepted/tizen/tv/20160316.081933 accepted/tizen/wearable/20160316.081950 submit/tizen/20160316.062840
authorSangyoon Jang <s89.jang@samsung.com>
Wed, 16 Mar 2016 06:11:29 +0000 (15:11 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 16 Mar 2016 06:14:09 +0000 (15:14 +0900)
- Add missing path:
<app_root>/lib/ug/<libname>.so

Change-Id: I0271da54639c79d69208e6ffc461085880b0aeec
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/module.c

index eecc9a8..2df10e2 100644 (file)
@@ -142,7 +142,7 @@ static int __get_ug_info(const char *name, char **ug_file_path)
        if (!__file_exist(ug_file))
                goto out_func;
 
-       /* get path using appid and root path */
+       /* get app root path */
        if (pkgmgrinfo_appinfo_get_usr_appinfo(app_id, getuid(), &appinfo)) {
                LOGE("failed to get app info");
                return -1;
@@ -152,6 +152,16 @@ static int __get_ug_info(const char *name, char **ug_file_path)
                pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
                return -1;
        }
+       /* get path using name and root path.
+        * in this case, try to get ug app's library in the same pacakge.
+        */
+       snprintf(ug_file, PATH_MAX, "%s/lib/ug/libug-%s.so", root_path, name);
+       if (!__file_exist(ug_file))
+               goto out_func;
+       snprintf(ug_file, PATH_MAX, "%s/lib/ug/lib%s.so", root_path, name);
+       if (!__file_exist(ug_file))
+               goto out_func;
+       /* get path using appid and root path */
        snprintf(ug_file, PATH_MAX, "%s/lib/ug/libug-%s.so", root_path, app_id);
        if (!__file_exist(ug_file))
                goto out_func;