From 9df203f876c617f67304fe436a339289dbbaf814 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Jul 2001 18:45:59 +0000 Subject: Wrapped dlerror() in the same way as the other dlxxx() calls. Jeremy. (This used to be commit ed5a1f70c6d155788b62e9e6e8c5d97a5ca0858d) --- source3/lib/system.c | 9 +++++++++ source3/passdb/passdb.c | 4 ++-- source3/smbd/vfs.c | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/lib/system.c b/source3/lib/system.c index 0799a855e8..185c1daa82 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -977,3 +977,12 @@ int sys_dlclose (void *handle) return 0; #endif } + +const char *sys_dlerror(void) +{ +#ifdef HAVE_LIBDL + return dlerror(); +#else + return NULL; +#endif +} diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 3bb49091e6..640be5b108 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -63,7 +63,7 @@ BOOL initialize_password_db(BOOL reload) if ((pdb_handle=sys_dlopen (modulename, RTLD_LAZY)) == NULL) { DEBUG(0,("initialize_password_db: ERROR - Unable to open passdb module \"%s\"!\n%s\n", - modulename, dlerror())); + modulename, sys_dlerror())); } else DEBUG(1,("initialize_password_db: passdb module \"%s\" loaded successfully\n", modulename)); @@ -76,7 +76,7 @@ BOOL initialize_password_db(BOOL reload) if ((pdb_handle=sys_dlopen ("libpdbfile.so", RTLD_LAZY)) == NULL) { DEBUG(0,("initialize_password_db: ERROR - Unable to open \"libpdbfile.so\" passdb module! No user authentication possible!\n%s\n", - dlerror())); + sys_dlerror())); return False; } else diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 71ebf9b506..50361564a5 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -117,7 +117,7 @@ static BOOL vfs_init_custom(connection_struct *conn) /* Open object file */ if ((conn->dl_handle = sys_dlopen(lp_vfsobj(SNUM(conn)), RTLD_NOW | RTLD_GLOBAL)) == NULL) { - DEBUG(0, ("Error opening %s: %s\n", lp_vfsobj(SNUM(conn)), dlerror())); + DEBUG(0, ("Error opening %s: %s\n", lp_vfsobj(SNUM(conn)), sys_dlerror())); return False; } -- cgit