X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fdynloader.c;h=92bae4aa8efde71a47408a4078a9f35e44e3ced9;hb=62a0c9f2573ff3478d103d67aba9090b67719ee9;hp=1f6dab1cd164c956ab981a0492d1775ad5346872;hpb=249d9c3c4e457f10f51a0744997b93026629c0fb;p=citadel.git diff --git a/citadel/dynloader.c b/citadel/dynloader.c index 1f6dab1cd..92bae4aa8 100644 --- a/citadel/dynloader.c +++ b/citadel/dynloader.c @@ -21,10 +21,12 @@ #include #endif #include +#include #include "dynloader.h" #include "citadel.h" #include "server.h" #include "sysdep_decls.h" +#include "tools.h" #ifndef HAVE_SNPRINTF #include @@ -74,8 +76,9 @@ int DLoader_Exec_Cmd(char *cmdbuf) void DLoader_Init(char *pathname) { void *fcn_handle; - const char *dl_error; + char dl_error[256]; DIR *dir; + int i; struct dirent *dptr; struct DLModule_Info *(*h_init_fcn) (void); struct DLModule_Info *dl_info; @@ -89,6 +92,7 @@ void DLoader_Init(char *pathname) while ((dptr = readdir(dir)) != NULL) { if (dptr->d_name[0] == '.') continue; + lprintf(9, "Attempting to load %s\n", dptr->d_name); snprintf(pathbuf, PATH_MAX, "%s/%s", pathname, dptr->d_name); #ifdef RTLD_NOW @@ -97,8 +101,12 @@ void DLoader_Init(char *pathname) if (!(fcn_handle = dlopen(pathbuf, DL_LAZY))) #endif { - /* dl_error = dlerror(); */ - fprintf(stderr, "DLoader_Init dlopen failed\n"); + safestrncpy(dl_error, dlerror(), sizeof dl_error); + for (i=0; i