Re: [PATCH 4/7] LOG: use libqb facility conversion functions

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

 



Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>

On 10/21/2011 12:57 AM, Angus Salkeld wrote:
> Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
> ---
>  exec/logsys.c                    |   47 --------------------------------------
>  exec/mainconfig.c                |    2 +-
>  include/corosync/engine/logsys.h |    6 -----
>  3 files changed, 1 insertions(+), 54 deletions(-)
> 
> diff --git a/exec/logsys.c b/exec/logsys.c
> index b6b16cb..4fd9cd4 100644
> --- a/exec/logsys.c
> +++ b/exec/logsys.c
> @@ -74,29 +74,6 @@ static struct syslog_names prioritynames[] =
>  	{ NULL, -1 }
>  };
>  
> -static struct syslog_names facilitynames[] =
> -{
> -	{ "auth", LOG_AUTH },
> -	{ "cron", LOG_CRON },
> -	{ "daemon", LOG_DAEMON },
> -	{ "kern", LOG_KERN },
> -	{ "lpr", LOG_LPR },
> -	{ "mail", LOG_MAIL },
> -	{ "news", LOG_NEWS },
> -	{ "syslog", LOG_SYSLOG },
> -	{ "user", LOG_USER },
> -	{ "uucp", LOG_UUCP },
> -	{ "local0", LOG_LOCAL0 },
> -	{ "local1", LOG_LOCAL1 },
> -	{ "local2", LOG_LOCAL2 },
> -	{ "local3", LOG_LOCAL3 },
> -	{ "local4", LOG_LOCAL4 },
> -	{ "local5", LOG_LOCAL5 },
> -	{ "local6", LOG_LOCAL6 },
> -	{ "local7", LOG_LOCAL7 },
> -	{ NULL, -1 }
> -};
> -
>  #define MAX_FILES_PER_SUBSYS 16
>  
>  /*
> @@ -702,30 +679,6 @@ int logsys_config_debug_set (
>  	return i;
>  }
>  
> -int logsys_facility_id_get (const char *name)
> -{
> -	unsigned int i;
> -
> -	for (i = 0; facilitynames[i].c_name != NULL; i++) {
> -		if (strcasecmp(name, facilitynames[i].c_name) == 0) {
> -			return (facilitynames[i].c_val);
> -		}
> -	}
> -	return (-1);
> -}
> -
> -const char *logsys_facility_name_get (unsigned int facility)
> -{
> -	unsigned int i;
> -
> -	for (i = 0; facilitynames[i].c_name != NULL; i++) {
> -		if (facility == facilitynames[i].c_val) {
> -			return (facilitynames[i].c_name);
> -		}
> -	}
> -	return (NULL);
> -}
> -
>  int logsys_priority_id_get (const char *name)
>  {
>  	unsigned int i;
> diff --git a/exec/mainconfig.c b/exec/mainconfig.c
> index d406428..8a6787f 100644
> --- a/exec/mainconfig.c
> +++ b/exec/mainconfig.c
> @@ -352,7 +352,7 @@ static int corosync_main_config_set (
>  	if (!objdb_get_string (objdb,object_handle, "syslog_facility", &value)) {
>  		int syslog_facility;
>  
> -		syslog_facility = logsys_facility_id_get(value);
> +		syslog_facility = qb_log_facility2int(value);
>  		if (syslog_facility < 0) {
>  			error_reason = "unknown syslog facility specified";
>  			goto parse_error;
> diff --git a/include/corosync/engine/logsys.h b/include/corosync/engine/logsys.h
> index 857c273..56a7236 100644
> --- a/include/corosync/engine/logsys.h
> +++ b/include/corosync/engine/logsys.h
> @@ -145,12 +145,6 @@ extern int logsys_config_debug_set (
>   *
>   * convert facility/priority to/from name/values
>   */
> -extern int logsys_facility_id_get (
> -	const char *name);
> -
> -extern const char *logsys_facility_name_get (
> -	unsigned int facility);
> -
>  extern int logsys_priority_id_get (
>  	const char *name);
>  

_______________________________________________
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