LOG: cleanup logging resources at exit

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Angus Salkeld 2011-11-11 09:05:08 +11:00
parent 21f1008be8
commit 0fc51c40fd
3 changed files with 17 additions and 1 deletions

View File

@ -243,6 +243,20 @@ static const char *_logsys_tags_stringify(uint32_t tags)
}
}
void logsys_system_fini (void)
{
int i;
int f;
for (i = 0; i < LOGSYS_MAX_SUBSYS_COUNT; i++) {
free(logsys_loggers[i].logfile);
for (f = 0; i < logsys_loggers[i].file_idx; f++) {
free(logsys_loggers[i].files[f]);
}
}
qb_log_fini ();
}
/*
* Internal API - exported
*/

View File

@ -147,7 +147,7 @@ void _corosync_exit_error (
log_printf (LOGSYS_LEVEL_ERROR, "Corosync Cluster Engine exiting "
"with status %d at %s:%u.\n", err, file, line);
}
qb_log_fini();
logsys_system_fini ();
exit (err);
}

View File

@ -157,6 +157,8 @@ extern int _logsys_system_setup(
int syslog_facility,
int syslog_priority);
extern void logsys_system_fini (void);
extern int _logsys_config_subsys_get (
const char *subsys);