Print this page
NEX-18699 libfmd_snmp needs to prevent double loading
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Reviewed by: Cynthia Eastham <cynthia.eastham@nexenta.com>
NEX-17796 libfmd_snmp performance is awful
Reviewed by: Cynthia Eastham <cynthia.eastham@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>

*** 35,45 **** static const sunFm_table_t sun_fm_tables[] = { TABLE_REG(sunFmModuleTable), TABLE_REG(sunFmResourceTable), TABLE_REG(sunFmProblemTable), - TABLE_REG(sunFmFaultEventTable), TABLE_NULL }; /* * This is our entry point for initialization by the agent, which --- 35,44 ----
*** 47,59 **** --- 46,62 ---- * by the agent API. */ int init_sunFM(void) { + static int once = 0; int max_err = MIB_REGISTERED_OK; const sunFm_table_t *table; + if (once != 0) + return (MIB_DUPLICATE_REGISTRATION); + for (table = sun_fm_tables; table->t_name != NULL; table++) { int err = table->t_init(); switch (err) { case MIB_REGISTERED_OK:
*** 78,84 **** --- 81,88 ---- if (err > max_err) max_err = err; } + once = 1; return (max_err); }