Re: [PATCH 5/7] LOG: cleanup logging resources at exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On second thought, shouldnt this be in corosync_exit_error instead?
(with the qb_log_fini)

Regards
-steve
On 11/10/2011 03:54 AM, Angus Salkeld wrote:
> Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
> ---
>  exec/logsys.c                    |   14 ++++++++++++++
>  exec/main.c                      |    2 ++
>  include/corosync/engine/logsys.h |    2 ++
>  3 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/exec/logsys.c b/exec/logsys.c
> index d92a2e3..158bf1a 100644
> --- a/exec/logsys.c
> +++ b/exec/logsys.c
> @@ -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
>   */
> diff --git a/exec/main.c b/exec/main.c
> index 444e59c..957634e 100644
> --- a/exec/main.c
> +++ b/exec/main.c
> @@ -1648,6 +1648,8 @@ int main (int argc, char **argv, char **envp)
>  	 */
>  	qb_loop_destroy (corosync_poll_handle);
>  
> +	logsys_system_fini ();
> +
>  	/*
>  	 * Remove pid lock file
>  	 */
> diff --git a/include/corosync/engine/logsys.h b/include/corosync/engine/logsys.h
> index cfd8a89..247881e 100644
> --- a/include/corosync/engine/logsys.h
> +++ b/include/corosync/engine/logsys.h
> @@ -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);
>  

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux