Remove sys_dl*() - stubs are already provided by libreplace.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:49:49 +0000 (03:49 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 02:49:49 +0000 (03:49 +0100)
source3/include/proto.h
source3/lib/module.c
source3/lib/system.c
source3/modules/gpfs.c
source3/torture/nsstest.c

index ee6dcc16014ff43473b3b41e5f123c41c2d5e853..8495d1e78d84cea3b7985db794ddd6f2b92770f7 100644 (file)
@@ -1020,10 +1020,6 @@ pid_t sys_fork(void);
 pid_t sys_getpid(void);
 int sys_popen(const char *command);
 int sys_pclose(int fd);
-void *sys_dlopen(const char *name, int flags);
-void *sys_dlsym(void *handle, const char *symbol);
-int sys_dlclose (void *handle);
-const char *sys_dlerror(void);
 int sys_dup2(int oldfd, int newfd) ;
 ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size);
 ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size);
index 76983387ffd03e172869edb374969e4d813ad024..de136680092f87fc85863cf4b0cbc45596c5fb11 100644 (file)
@@ -37,11 +37,11 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
         * backwards compatibility, there might be symbols in the 
         * plugin referencing to old (removed) functions
         */
-       handle = sys_dlopen(module_name, RTLD_LAZY);
+       handle = dlopen(module_name, RTLD_LAZY);
 
        /* This call should reset any possible non-fatal errors that 
           occured since last call to dl* functions */
-       error = sys_dlerror();
+       error = dlerror();
 
        if(!handle) {
                int level = is_probe ? 3 : 0;
@@ -49,15 +49,15 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       init = (init_module_function *)sys_dlsym(handle, "init_samba_module");
+       init = (init_module_function *)dlsym(handle, "init_samba_module");
 
-       /* we must check sys_dlerror() to determine if it worked, because
-           sys_dlsym() can validly return NULL */
-       error = sys_dlerror();
+       /* we must check dlerror() to determine if it worked, because
+           dlsym() can validly return NULL */
+       error = dlerror();
        if (error) {
                DEBUG(0, ("Error trying to resolve symbol 'init_samba_module' "
                          "in %s: %s\n", module_name, error));
-               sys_dlclose(handle);
+               dlclose(handle);
                return NT_STATUS_UNSUCCESSFUL;
        }
 
@@ -67,7 +67,7 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("Module '%s' initialization failed: %s\n",
                            module_name, get_friendly_nt_error_msg(status)));
-               sys_dlclose(handle);
+               dlclose(handle);
        }
 
        return status;
index d23e7ae6db46b5275276091679c03fededa0d196..90dbdafa923fa926c6d9953f6020cbfb146c5271 100644 (file)
@@ -1190,46 +1190,6 @@ int sys_pclose(int fd)
        return wstatus;
 }
 
-/**************************************************************************
- Wrappers for dlopen, dlsym, dlclose.
-****************************************************************************/
-
-void *sys_dlopen(const char *name, int flags)
-{
-#if defined(HAVE_DLOPEN)
-       return dlopen(name, flags);
-#else
-       return NULL;
-#endif
-}
-
-void *sys_dlsym(void *handle, const char *symbol)
-{
-#if defined(HAVE_DLSYM)
-    return dlsym(handle, symbol);
-#else
-    return NULL;
-#endif
-}
-
-int sys_dlclose (void *handle)
-{
-#if defined(HAVE_DLCLOSE)
-       return dlclose(handle);
-#else
-       return 0;
-#endif
-}
-
-const char *sys_dlerror(void)
-{
-#if defined(HAVE_DLERROR)
-       return dlerror();
-#else
-       return NULL;
-#endif
-}
-
 int sys_dup2(int oldfd, int newfd) 
 {
 #if defined(HAVE_DUP2)
index 590dbac26fe41c42108e4ef6717d7cd45519b116..a0d33fa33a0c1919a0dcfe38691b2c1856f9b1b8 100644 (file)
@@ -141,40 +141,40 @@ void init_gpfs(void)
                return;
        }
 
-       libgpfs_handle = sys_dlopen("libgpfs_gpl.so", RTLD_LAZY);
+       libgpfs_handle = dlopen("libgpfs_gpl.so", RTLD_LAZY);
 
        if (libgpfs_handle == NULL) {
-               DEBUG(10, ("sys_dlopen for libgpfs_gpl failed: %s\n",
+               DEBUG(10, ("dlopen for libgpfs_gpl failed: %s\n",
                           strerror(errno)));
                return;
        }
 
        DEBUG(10, ("libgpfs_gpl.so loaded\n"));
 
-       gpfs_set_share_fn = sys_dlsym(libgpfs_handle, "gpfs_set_share");
+       gpfs_set_share_fn = dlsym(libgpfs_handle, "gpfs_set_share");
        if (gpfs_set_share_fn == NULL) {
                DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
                          "'gpfs_set_share'\n"));
                goto failed;
        }
 
-       gpfs_set_lease_fn = sys_dlsym(libgpfs_handle, "gpfs_set_lease");
+       gpfs_set_lease_fn = dlsym(libgpfs_handle, "gpfs_set_lease");
        if (gpfs_set_lease_fn == NULL) {
                DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
                          "'gpfs_set_lease'\n"));
-               sys_dlclose(libgpfs_handle);
+               dlclose(libgpfs_handle);
 
                goto failed;
        }
 
-       gpfs_getacl_fn = sys_dlsym(libgpfs_handle, "gpfs_getacl");
+       gpfs_getacl_fn = dlsym(libgpfs_handle, "gpfs_getacl");
        if (gpfs_getacl_fn == NULL) {
                DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
                          "'gpfs_getacl'\n"));
                goto failed;
        }
 
-       gpfs_putacl_fn = sys_dlsym(libgpfs_handle, "gpfs_putacl");
+       gpfs_putacl_fn = dlsym(libgpfs_handle, "gpfs_putacl");
        if (gpfs_putacl_fn == NULL) {
                DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
                          "'gpfs_putacl'\n"));
@@ -187,7 +187,7 @@ void init_gpfs(void)
        return;
 
 failed:
-       sys_dlclose(libgpfs_handle);
+       dlclose(libgpfs_handle);
        /* leave libgpfs_handle != NULL around, no point
           in trying twice */
        gpfs_set_share_fn = NULL;
index 6bd0efe1af0035a80f9b9f64fdbcff8723d617df..352b3fa33c08b56dada14458e51aae6af6f23eee 100644 (file)
@@ -37,13 +37,13 @@ static void *find_fn(const char *name)
        }
 
        if (!h) {
-               h = sys_dlopen(so_path, RTLD_LAZY);
+               h = dlopen(so_path, RTLD_LAZY);
        }
        if (!h) {
                printf("Can't open shared library %s\n", so_path);
                exit(1);
        }
-       res = sys_dlsym(h, s);
+       res = dlsym(h, s);
        if (!res) {
                printf("Can't find function %s\n", s);
                total_errors++;