summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-07-06 18:45:59 +0000
committerJeremy Allison <jra@samba.org>2001-07-06 18:45:59 +0000
commit9df203f876c617f67304fe436a339289dbbaf814 (patch)
tree9c357d5484bb8cf368c4eac880161174c83be73d
parentdf68e652d6411f11d9cb00aefb15c8a62ef1f149 (diff)
downloadsamba-9df203f876c617f67304fe436a339289dbbaf814.tar.gz
samba-9df203f876c617f67304fe436a339289dbbaf814.tar.bz2
samba-9df203f876c617f67304fe436a339289dbbaf814.zip
Wrapped dlerror() in the same way as the other dlxxx() calls.
Jeremy. (This used to be commit ed5a1f70c6d155788b62e9e6e8c5d97a5ca0858d)
-rw-r--r--source3/lib/system.c9
-rw-r--r--source3/passdb/passdb.c4
-rw-r--r--source3/smbd/vfs.c2
3 files changed, 12 insertions, 3 deletions
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;
}