diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-12 12:00:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-12 12:00:11 (GMT) |
commit | ece45e7fb6469e3ee3ad49f168f8711fb36f93ce (patch) | |
tree | db4a77927de2a4d6c6cf2bc672ebda4098b9b1a0 /unix/tclLoadDl.c | |
parent | 6f3388528ef453d29fbddba3f5a054d2f5268207 (diff) | |
parent | 473bfc0f18451046035f638732a609fc86d5a0aa (diff) | |
download | tcl-ece45e7fb6469e3ee3ad49f168f8711fb36f93ce.zip tcl-ece45e7fb6469e3ee3ad49f168f8711fb36f93ce.tar.gz tcl-ece45e7fb6469e3ee3ad49f168f8711fb36f93ce.tar.bz2 |
merge trunkinitsubsystems
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r-- | unix/tclLoadDl.c | 25 |
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; } |