At least for the two common Unixly DSO loading methods, include the
system error in the error text.
This commit is contained in:
parent
c85a157854
commit
acf60ef707
2 changed files with 9 additions and 6 deletions
|
@ -130,7 +130,8 @@ static int dl_load(DSO *dso)
|
|||
if(ptr == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_DL_LOAD,DSO_R_LOAD_FAILED);
|
||||
ERR_add_error_data(3, "filename(", filename, ")");
|
||||
ERR_add_error_data(4, "filename(", filename, "): ",
|
||||
strerror(errno));
|
||||
goto err;
|
||||
}
|
||||
if(!sk_push(dso->meth_data, (char *)ptr))
|
||||
|
@ -199,7 +200,8 @@ static void *dl_bind_var(DSO *dso, const char *symname)
|
|||
if (shl_findsym(&ptr, symname, TYPE_UNDEFINED, &sym) < 0)
|
||||
{
|
||||
DSOerr(DSO_F_DL_BIND_VAR,DSO_R_SYM_FAILURE);
|
||||
ERR_add_error_data(3, "symname(", symname, ")");
|
||||
ERR_add_error_data(4, "symname(", symname, "): ",
|
||||
strerror(errno));
|
||||
return(NULL);
|
||||
}
|
||||
return(sym);
|
||||
|
@ -229,7 +231,8 @@ static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname)
|
|||
if (shl_findsym(&ptr, symname, TYPE_UNDEFINED, &sym) < 0)
|
||||
{
|
||||
DSOerr(DSO_F_DL_BIND_FUNC,DSO_R_SYM_FAILURE);
|
||||
ERR_add_error_data(3, "symname(", symname, ")");
|
||||
ERR_add_error_data(4, "symname(", symname, "): ",
|
||||
strerror(errno));
|
||||
return(NULL);
|
||||
}
|
||||
return((DSO_FUNC_TYPE)sym);
|
||||
|
|
|
@ -147,7 +147,7 @@ static int dlfcn_load(DSO *dso)
|
|||
if(ptr == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_DLFCN_LOAD,DSO_R_LOAD_FAILED);
|
||||
ERR_add_error_data(3, "filename(", filename, ")");
|
||||
ERR_add_error_data(4, "filename(", filename, "): ", dlerror());
|
||||
goto err;
|
||||
}
|
||||
if(!sk_push(dso->meth_data, (char *)ptr))
|
||||
|
@ -215,7 +215,7 @@ static void *dlfcn_bind_var(DSO *dso, const char *symname)
|
|||
if(sym == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_DLFCN_BIND_VAR,DSO_R_SYM_FAILURE);
|
||||
ERR_add_error_data(3, "symname(", symname, ")");
|
||||
ERR_add_error_data(4, "symname(", symname, "): ", dlerror());
|
||||
return(NULL);
|
||||
}
|
||||
return(sym);
|
||||
|
@ -246,7 +246,7 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
|
|||
if(sym == NULL)
|
||||
{
|
||||
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_SYM_FAILURE);
|
||||
ERR_add_error_data(3, "symname(", symname, ")");
|
||||
ERR_add_error_data(4, "symname(", symname, "): ", dlerror());
|
||||
return(NULL);
|
||||
}
|
||||
return(sym);
|
||||
|
|
Loading…
Reference in a new issue