openbsd-ports/net/net-snmp/patches/patch-agent_mibgroup_ucd-snmp_dlmod_c
2010-10-25 22:59:12 +00:00

29 lines
1.0 KiB
Plaintext

$OpenBSD: patch-agent_mibgroup_ucd-snmp_dlmod_c,v 1.4 2010/10/25 22:59:12 sthen Exp $
--- agent/mibgroup/ucd-snmp/dlmod.c.orig Wed Jun 16 22:34:42 2010
+++ agent/mibgroup/ucd-snmp/dlmod.c Wed Oct 6 23:25:17 2010
@@ -181,7 +181,12 @@ 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);
@@ -205,7 +210,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) {
DEBUGMSGTL(("dlmod", "Calling deinit_%s()\n", dlm->name));