Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > a83f40207f819e6ccd69f11459a18ae2 > files > 2

ogdi-3.1.5-4mdv2009.0.src.rpm

--- ogdi-3.1.1/ogdi/c-api/ecs_dyna.c.orig	Mon Apr  9 17:04:34 2001
+++ ogdi-3.1.1/ogdi/c-api/ecs_dyna.c	Tue Jun 18 21:37:08 2002
@@ -73,9 +73,27 @@
     return (void *) handle;
   }
 #else
+#define MODULES_PATH "/usr/lib/ogdi/"
   void *handle;
 
   handle = dlopen(libname,RTLD_LAZY);
+  if (handle != NULL)
+    return handle;
+
+  if ((temp = (char *) malloc(strlen(MODULES_PATH)+strlen(libname)+1)) == NULL)
+    return NULL;
+  sprintf(temp,MODULES_PATH "%s",libname);
+  handle = dlopen(temp,RTLD_LAZY);
+  free(temp);
+  if (handle != NULL)
+    return handle;
+
+  if ((temp = (char *) malloc(strlen(MODULES_PATH)+strlen(libname)+7)) == NULL)
+    return NULL;
+  sprintf(temp,MODULES_PATH "lib%s.so",libname);
+  handle = dlopen(temp,RTLD_LAZY);
+  free(temp);
+
   if (handle == NULL) {
     /* Try with the .so extension */