MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / clean_up

Function clean_up

tools/crm_mon.c:2257–2292  ·  view source on GitHub ↗

* De-init ncurses, signoff from the CIB and deallocate memory. */

Source from the content-addressed store, hash-verified

2255 * De-init ncurses, signoff from the CIB and deallocate memory.
2256 */
2257void
2258clean_up(int rc)
2259{
2260#if ENABLE_SNMP
2261 netsnmp_session *session = crm_snmp_init(NULL, NULL);
2262
2263 if (session) {
2264 snmp_close(session);
2265 snmp_shutdown("snmpapp");
2266 }
2267#endif
2268
2269#if CURSES_ENABLED
2270 if (as_console) {
2271 as_console = FALSE;
2272 echo();
2273 nocbreak();
2274 endwin();
2275 }
2276#endif
2277
2278 if (cib != NULL) {
2279 cib->cmds->signoff(cib);
2280 cib_delete(cib);
2281 cib = NULL;
2282 }
2283
2284 free(as_html_file);
2285 free(xml_file);
2286 free(pid_file);
2287
2288 if (rc >= 0) {
2289 crm_exit(rc);
2290 }
2291 return;
2292}

Callers 4

mon_shutdownFunction · 0.85
cib_connectFunction · 0.85
mainFunction · 0.85
mon_refresh_displayFunction · 0.85

Calls 3

crm_snmp_initFunction · 0.85
cib_deleteFunction · 0.85
crm_exitFunction · 0.85

Tested by

no test coverage detected