fc8876006b
suggested by brad@
28 lines
1003 B
Plaintext
28 lines
1003 B
Plaintext
$OpenBSD: patch-agent_mibgroup_ucd-snmp_dlmod_c,v 1.2 2002/02/19 14:19:54 danh Exp $
|
|
--- agent/mibgroup/ucd-snmp/dlmod.c.orig Fri Oct 5 11:50:42 2001
|
|
+++ agent/mibgroup/ucd-snmp/dlmod.c Mon Feb 18 12:39:29 2002
|
|
@@ -175,7 +175,11 @@ dlmod_load_module(struct dlmod *dlm)
|
|
if (dlm->status == DLMOD_ERROR)
|
|
return;
|
|
}
|
|
+#ifdef __ELF__
|
|
snprintf(sym_init, sizeof(sym_init), "init_%s", dlm->name);
|
|
+#else
|
|
+ snprintf(sym_init, sizeof(sym_init), "_init_%s", dlm->name);
|
|
+#endif
|
|
dl_init = dlsym(dlm->handle, sym_init);
|
|
if (dl_init == NULL) {
|
|
dlclose(dlm->handle);
|
|
@@ -199,7 +203,11 @@ dlmod_unload_module (struct dlmod *dlm)
|
|
if (!dlm || dlm->status != DLMOD_LOADED)
|
|
return;
|
|
|
|
+#ifdef __ELF__
|
|
snprintf(sym_deinit, sizeof(sym_deinit), "deinit_%s", dlm->name);
|
|
+#else
|
|
+ snprintf(sym_deinit, sizeof(sym_deinit), "_deinit_%s", dlm->name);
|
|
+#endif
|
|
dl_deinit = dlsym(dlm->handle, sym_deinit);
|
|
if (dl_deinit == NULL) {
|
|
snprintf(dlm->error, sizeof(dlm->error),
|