Fix getting ug info 85/255585/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 19 Mar 2021 09:10:12 +0000 (18:10 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 19 Mar 2021 09:10:12 +0000 (18:10 +0900)
- Removes unnecessary slash
- Checks whether shared/res/lib<name>.so file exists or not

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

index 10450c25b7cabf3c57cab032c85372058a5fde5a..b5d5306118d552a79685d9b8750b181c6213b69a 100644 (file)
@@ -184,10 +184,13 @@ static int __get_ug_info(const char *name, char **ug_file_path)
                pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
                return -1;
        }
-       snprintf(ug_file, PATH_MAX, "%s/lib/ug/libug-%s.so", res_path, name);
+       snprintf(ug_file, PATH_MAX, "%slib/ug/libug-%s.so", res_path, name);
        if (!__file_exist(ug_file))
                goto out_func;
-       snprintf(ug_file, PATH_MAX, "%s/lib/ug/lib-%s.so", res_path, name);
+       snprintf(ug_file, PATH_MAX, "%slib/ug/lib-%s.so", res_path, name);
+       if (!__file_exist(ug_file))
+               goto out_func;
+       snprintf(ug_file, PATH_MAX, "%slib/ug/lib%s.so", res_path, name);
        if (!__file_exist(ug_file))
                goto out_func;