summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/dln.c b/dln.c
index 127ceabada..d9bacb78c4 100644
--- a/dln.c
+++ b/dln.c
@@ -1214,7 +1214,7 @@ aix_loaderror(const char *pathname)
}
#endif
-void
+void*
dln_load(file)
const char *file;
{
@@ -1242,13 +1242,13 @@ dln_load(file)
}
/* Call the init code */
(*init_fct)();
- return;
+ return handle;
#else
#ifdef USE_DLN_A_OUT
if (load(file) == -1) {
goto failed;
}
- return;
+ return 0;
#else
char buf[MAXPATHLEN];
@@ -1274,11 +1274,12 @@ dln_load(file)
}
if ((init_fct = (void(*)())dlsym(handle, buf)) == NULL) {
+ dlclose(handle);
goto failed;
}
/* Call the init code */
(*init_fct)();
- return;
+ return handle;
}
#endif /* USE_DLN_DLOPEN */
@@ -1304,7 +1305,7 @@ dln_load(file)
}
}
(*init_fct)();
- return;
+ return (void*)lib;
}
#endif /* hpux */
@@ -1321,7 +1322,7 @@ dln_load(file)
aix_loaderror(file);
}
(*init_fct)();
- return;
+ return (void*)init_fct;
}
#endif /* _AIX */
@@ -1360,7 +1361,7 @@ dln_load(file)
init_fct = (void(*)())init_address;
(*init_fct)();
- return;
+ return (void*)init_address;
}
#else/* OPENSTEP dyld functions */
{
@@ -1390,7 +1391,7 @@ dln_load(file)
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));
(*init_fct)();
- return;
+ return (void*)init_fct;
}
#endif /* rld or dyld */
#endif
@@ -1438,7 +1439,7 @@ dln_load(file)
/* call module initialize function. */
(*init_fct)();
- return;
+ return (void*)img_id;
}
#endif /* __BEOS__*/
@@ -1486,7 +1487,7 @@ dln_load(file)
init_fct = (void (*)())symAddr;
(*init_fct)();
- return;
+ return (void*)init_fct;
}
#endif /* __MACOS__ */