Changeset 4a600df in tol


Ignore:
Timestamp:
Jun 19, 2015, 11:07:45 AM (11 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
2bec99e
Parents:
64eb621
Message:

Refs #1851
Se modifica LoadDynLib de modo que el directorio utilizado por defecto para la carga de la librería sea su propio directorio y no el directorio de trabajo actual en ese momento (cwd).

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@6768 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/LoadDynLib/LoadDynLib.cpp

    r64eb621 r4a600df  
    8282  "(Text libraryPath [, Text libraryName])",
    8383  I2("Link a dynamic library without TOL built-in functions.",
    84      "Enlaca una librería dinámica sin funciones TOL nativas."),
     84     "Enlaza una librería dinámica sin funciones TOL nativas."),
    8585     BOperClassify::Statistic_);
    8686  void BDatLoadDynLib::CalcContens()
    … …  
    9898  BUserNameBlock* unb = NULL;
    9999
     100  // se cambia el directorio de trabajo (cwd) inicial
     101  BText currentDir = BDir::GetCurrent();
     102  BDir::ChangeCurrent(GetFilePath(libraryPath));
     103
    100104  lt_dlhandle handleLib;
    101105
    102106  // abro la DynLib
    103107  handleLib = lt_dlopen( libraryPath );
     108 
     109  // se retorna al directorio de trabajo (cwd) inicial
     110  BDir::ChangeCurrent(currentDir);
     111
    104112  if ( !handleLib )
    105113  {
    … …  
    125133    "(Text libraryPath [, Text libraryName])",
    126134    I2("Returns a NameBlock that contains methods and members written "
    127     "in C + + in a precompiled library for dynamic linking. Once "
     135    "in C++ in a precompiled library for dynamic linking. Once "
    128136    "loaded Nameblock is nothing particular and can be used like "
    129137    "any other object created with language TOL. See more details on ",
    … …  
    153161//Std(BText("\nTRACE BLoadDynLib::Evaluator 1 libraryPath=")+libraryPath);
    154162//Std(BText("\nTRACE BLoadDynLib::Evaluator 2 libraryName=")+libraryName);
     163
    155164  BUserNameBlock* unb = NULL;
     165
     166  // se cambia el directorio de trabajo (cwd) inicial
     167  BText currentDir = BDir::GetCurrent();
     168  BDir::ChangeCurrent(GetFilePath(libraryPath));
    156169
    157170  lt_dlhandle handleLib;
    … …  
    159172  // abro la DynLib
    160173  handleLib = lt_dlopen( libraryPath );
     174
     175  // se retorna al directorio de trabajo (cwd) inicial
     176  BDir::ChangeCurrent(currentDir);
     177
    161178  if ( !handleLib )
    162179  {
Note: See TracChangeset for help on using the changeset viewer.