From 8daf7ceabbb09f12794885e6513272e45940b80a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 30 Mar 2009 21:16:24 +0000 Subject: [PATCH] main.c: avoid a few warnings FIXME: merge with another? * exec/main.c (ipc_log_printf): Add const. (main): tweak config_iface handling git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1959 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/exec/main.c b/exec/main.c index b29f9521..086c09a7 100644 --- a/exec/main.c +++ b/exec/main.c @@ -598,7 +598,7 @@ static void corosync_sending_allowed_release (void *sending_allowed_private_data static int ipc_subsys_id = -1; -static void ipc_log_printf (char *format, ...) { +static void ipc_log_printf (const char *format, ...) { va_list ap; va_start (ap, format); @@ -683,7 +683,8 @@ int main (int argc, char **argv) void *objdb_p; struct config_iface_ver0 *config; void *config_p; - const char *config_iface; + const char *config_iface_init; + char *config_iface; char *iface; int res, ch; int background, setprio; @@ -772,13 +773,13 @@ int main (int argc, char **argv) * the corosync default built in parser if the configuration parser * isn't overridden */ - config_iface = getenv("COROSYNC_DEFAULT_CONFIG_IFACE"); - if (!config_iface) { - config_iface = "corosync_parser"; + config_iface_init = getenv("COROSYNC_DEFAULT_CONFIG_IFACE"); + if (!config_iface_init) { + config_iface_init = "corosync_parser"; } /* Make a copy so we can deface it with strtok */ - config_iface = strdup(config_iface); + config_iface = strdup(config_iface_init); iface = strtok(config_iface, ":"); while (iface)