Author: qboosh                       Date: Thu Jan 24 15:45:15 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- open module using full path, without chdir() and requiring any rpath

---- Files affected:
SOURCES:
   mpg123-no-la.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/mpg123-no-la.patch
diff -u SOURCES/mpg123-no-la.patch:1.1 SOURCES/mpg123-no-la.patch:1.2
--- SOURCES/mpg123-no-la.patch:1.1      Thu Jan 24 00:42:35 2008
+++ SOURCES/mpg123-no-la.patch  Thu Jan 24 16:45:10 2008
@@ -9,3 +9,54 @@
  #define MODULE_SYMBOL_PREFIX  "mpg123_"
  #define MODULE_SYMBOL_SUFFIX  "_module_info"
  
+@@ -77,12 +77,10 @@
+       size_t module_symbol_len = 0;
+       char *workdir = NULL;
+       char *moddir  = NULL;
+-      workdir = get_the_cwd();
+       moddir  = get_module_dir();
+-      if(workdir == NULL || moddir == NULL)
++      if(moddir == NULL)
+       {
+-              error("Failure getting workdir or moddir!");
+-              if(workdir != NULL) free(workdir);
++              error("Failure getting moddir!");
+               if(moddir  != NULL) free(moddir);
+               return NULL;
+       }
+@@ -75,7 +75,6 @@
+       size_t module_path_len = 0;
+       char* module_symbol = NULL;
+       size_t module_symbol_len = 0;
+-      char *workdir = NULL;
+       char *moddir  = NULL;
+       moddir  = get_module_dir();
+       if(moddir == NULL)
+@@ -90,15 +87,14 @@
+       /* Initialize libltdl */
+       if (lt_dlinit()) error( "Failed to initialise libltdl" );
+ 
+-      chdir(moddir);
+       /* Work out the path of the module to open */
+-      module_path_len = strlen(type) + 1 + strlen(name) + 
strlen(MODULE_FILE_SUFFIX) + 1;
++      module_path_len = strlen(moddir) + 1 + strlen(type) + 1 + strlen(name) 
+ strlen(MODULE_FILE_SUFFIX) + 1;
+       module_path = malloc( module_path_len );
+       if (module_path == NULL) {
+               error1( "Failed to allocate memory for module name: %s", 
strerror(errno) );
+               goto om_bad;
+       }
+-      snprintf( module_path, module_path_len, "%s_%s%s", type, name, 
MODULE_FILE_SUFFIX );
++      snprintf( module_path, module_path_len, "%s/%s_%s%s", moddir, type, 
name, MODULE_FILE_SUFFIX );
+       /* Display the path of the module created */
+       debug1( "Module path: %s", module_path );
+ 
+@@ -144,9 +140,7 @@
+ om_bad:
+       module = NULL;
+ om_end:
+-      chdir(workdir);
+       free(moddir);
+-      free(workdir);
+       return module;
+ }
+ 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mpg123-no-la.patch?r1=1.1&r2=1.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to