Removed deprecated api g_module_build_path 42/307442/1 accepted/tizen/unified/20240308.174253 accepted/tizen/unified/x/20240311.100153
authorPriya Kohli <priya.kohli@samsung.com>
Fri, 8 Mar 2024 08:23:45 +0000 (13:53 +0530)
committerPriya Kohli <priya.kohli@samsung.com>
Fri, 8 Mar 2024 08:23:45 +0000 (13:53 +0530)
Change-Id: Iede0af07bb86f247d078462b981e693390e74b50
Signed-off-by: Priya Kohli <priya.kohli@samsung.com>
src/manager/module-internal.c

index c8f8e1be6d28d9a1ef4ae2b47dbece72a9d027f3..bb50ed2ec7c4e01cfca1b64000169c967162ccb7 100644 (file)
 
 #define MAX_MODULE_INDEX 4
 
+static gchar* _g_module_build_path (const gchar *directory, const gchar *module_name)
+{
+       if (directory && *directory) {
+               if (strncmp(module_name, "lib", 3) == 0)
+                       return g_strconcat(directory, "/", module_name, NULL);
+       else
+               return g_strconcat(directory, "/lib", module_name, "." G_MODULE_SUFFIX, NULL);
+       } else if (strncmp (module_name, "lib", 3) == 0)
+               return g_strdup(module_name);
+       else
+               return g_strconcat("lib", module_name, "." G_MODULE_SUFFIX, NULL);
+}
+
 static GMod *gmod_new(const char *module_name, gboolean is_resident)
 {
        if (!module_name)
@@ -34,7 +47,7 @@ static GMod *gmod_new(const char *module_name, gboolean is_resident)
                g_free(gmod);
                return NULL;
        }
-       gmod->path = g_module_build_path(MODULE_PATH_PREFIX, gmod->name);
+       gmod->path = _g_module_build_path(MODULE_PATH_PREFIX, gmod->name);
 
        if (!gmod->path) {
                g_free(gmod->name);