summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadDl.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-09-08 13:01:31 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-09-08 13:01:31 (GMT)
commitfa105712c19ab4f84d85f6e33cb51a85e2ad259f (patch)
treea7a9bb771e8cb47db9ba5834f8790aa617861bf5 /unix/tclLoadDl.c
parentd2c080833061d96d6d76d4d3873e15796cdd815c (diff)
parent600412a708fa193015ef5e22f66d6d4ceee741cc (diff)
downloadtcl-fa105712c19ab4f84d85f6e33cb51a85e2ad259f.zip
tcl-fa105712c19ab4f84d85f6e33cb51a85e2ad259f.tar.gz
tcl-fa105712c19ab4f84d85f6e33cb51a85e2ad259f.tar.bz2
merge 8.6.5
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r--unix/tclLoadDl.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index dc711f8..aec071c 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -124,9 +124,11 @@ TclpDlopen(
const char *errorStr = dlerror();
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't load file \"%s\": %s",
- Tcl_GetString(pathPtr), errorStr));
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "couldn't load file \"%s\": %s",
+ Tcl_GetString(pathPtr), errorStr));
+ }
return TCL_ERROR;
}
newHandle = ckalloc(sizeof(*newHandle));
@@ -187,17 +189,18 @@ FindSymbol(
Tcl_DStringFree(&newName);
}
Tcl_DStringFree(&ds);
- if (proc == NULL && interp != NULL) {
+ if (proc == NULL) {
const char *errorStr = dlerror();
- if (!errorStr) {
- errorStr = "unknown";
+ if (interp) {
+ if (!errorStr) {
+ errorStr = "unknown";
+ }
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "cannot find symbol \"%s\": %s", symbol, errorStr));
+ Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
+ NULL);
}
-
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\": %s", symbol, errorStr));
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
- NULL);
}
return proc;
}