summaryrefslogtreecommitdiffstats
path: root/scilab/modules/core
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2010-04-01 17:35:41 +0200
committerSylvestre Ledru <sylvestre.ledru@scilab.org>2010-04-01 17:35:41 +0200
commit414286b8a8f224857c866284b58334b7cb4ff19b (patch)
tree0324854c939171e9588fd6558fb78f5f8ad5fb11 /scilab/modules/core
parent3d8f7fcc07395efe2269081a92ce748592df7996 (diff)
downloadscilab-414286b8a8f224857c866284b58334b7cb4ff19b.zip
scilab-414286b8a8f224857c866284b58334b7cb4ff19b.tar.gz
* In some cases, when a library is not available, we try to find it into the
.libs of the module (it is the case in the development source tree). However, in the binary, for any reason, if we fail to load the library (missing symbol, bad format of library, etc), the error message was not displayed.
Diffstat (limited to 'scilab/modules/core')
-rw-r--r--scilab/modules/core/src/c/callDynamicGateway.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/scilab/modules/core/src/c/callDynamicGateway.c b/scilab/modules/core/src/c/callDynamicGateway.c
index 52dc74e..b230ceb 100644
--- a/scilab/modules/core/src/c/callDynamicGateway.c
+++ b/scilab/modules/core/src/c/callDynamicGateway.c
@@ -46,8 +46,11 @@ dynamic_gateway_error_code callDynamicGateway(char *moduleName,
46 } 46 }
47#else 47#else
48 *hlib = LoadDynLibrary(dynLibName); 48 *hlib = LoadDynLibrary(dynLibName);
49
49 if (*hlib == NULL) 50 if (*hlib == NULL)
50 { 51 {
52 char *previousError = GetLastDynLibError();
53
51 /* Haven't been able to find the lib with dlopen... 54 /* Haven't been able to find the lib with dlopen...
52 * This can happen for two reasons: 55 * This can happen for two reasons:
53 * - the lib must be dynamically linked 56 * - the lib must be dynamically linked
@@ -68,8 +71,12 @@ dynamic_gateway_error_code callDynamicGateway(char *moduleName,
68 71
69 if (*hlib == NULL) 72 if (*hlib == NULL)
70 { 73 {
71 if (SciPath) {FREE(SciPath); SciPath = NULL;} 74 if (previousError != NULL)
72 if (pathToLib) {FREE(pathToLib); pathToLib = NULL;} 75 {
76 sciprint("A previous error has been detected while loading %s: %s\n",dynLibName, previousError);
77 }
78 if (SciPath) {FREE(SciPath); SciPath = NULL;}
79 if (pathToLib) {FREE(pathToLib); pathToLib = NULL;}
73 return DYN_GW_LOAD_LIBRARY_ERROR; 80 return DYN_GW_LOAD_LIBRARY_ERROR;
74 } 81 }
75 if (SciPath) {FREE(SciPath); SciPath = NULL;} 82 if (SciPath) {FREE(SciPath); SciPath = NULL;}