From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7828 invoked by alias); 5 May 2009 17:40:53 -0000 Received: (qmail 7819 invoked by alias); 5 May 2009 17:40:52 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64,SPF_HELO_PASS X-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: the tag gfs_0_1_19 has been created To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/tags/gfs_0_1_19 X-Git-Reftype: tag X-Git-Oldrev: 1e648a83f6f5aa0c146ce25e8fd5c47c511077e5 X-Git-Newrev: d0b8e7806f394228329ff797c999a723d89d4d6e From: Chris Feist Message-Id: <20090505174012.3460B120315@lists.fedorahosted.org> Date: Tue, 05 May 2009 17:40:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00213.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d0b8e7806f394228329ff797c999a723d89d4d6e Commit: d0b8e7806f394228329ff797c999a723d89d4d6e Parent: 1e648a83f6f5aa0c146ce25e8fd5c47c511077e5 Author: Fabio M. Di Nitto AuthorDate: Tue May 5 09:02:04 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue May 5 09:03:53 2009 +0200 cman: fix cman_tool build warnings spotted by paranoia cflags Signed-off-by: Fabio M. Di Nitto --- cman/cman_tool/cman_tool.h | 2 +- cman/cman_tool/join.c | 10 ++++++---- cman/cman_tool/main.c | 9 +++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cman/cman_tool/cman_tool.h b/cman/cman_tool/cman_tool.h index 7476e1f..3766ee2 100644 --- a/cman/cman_tool/cman_tool.h +++ b/cman/cman_tool/cman_tool.h @@ -95,6 +95,6 @@ struct commandline typedef struct commandline commandline_t; int join(commandline_t *comline, char *envp[]); -char *cman_error(int err); +const char *cman_error(int err); #endif /* __CMAN_TOOL_DOT_H__ */ diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c index 9c78937..86a69c2 100644 --- a/cman/cman_tool/join.c +++ b/cman/cman_tool/join.c @@ -40,7 +40,7 @@ static void be_daemon(int close_stderr) } -static char *corosync_exit_reason(signed char status) +static const char *corosync_exit_reason(signed char status) { static char reason[256]; switch (status) { @@ -200,10 +200,12 @@ int join(commandline_t *comline, char *main_envp[]) /* Always run corosync -f because we have already forked twice anyway, and we want to return any exit code that might happen */ - argv[0] = "corosync"; - argv[++argvptr] = "-f"; + /* also strdup strings because it's otherwise virtually impossible to fix + * build warnings due to the way argv C implementation is done */ + argv[0] = strdup("corosync"); + argv[++argvptr] = strdup("-f"); if (comline->nosetpri_opt) - argv[++argvptr] = "-p"; + argv[++argvptr] = strdup("-p"); argv[++argvptr] = NULL; /* Fork/exec cman */ diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c index 450b31c..aef82ac 100644 --- a/cman/cman_tool/main.c +++ b/cman/cman_tool/main.c @@ -473,9 +473,9 @@ static int show_services(void) } -char *cman_error(int err) +const char *cman_error(int err) { - char *die_error; + const char *die_error; switch (errno) { case ENOTCONN: @@ -696,8 +696,6 @@ static void decode_arguments(int argc, char *argv[], commandline_t *comline) int optchar, i; int show_help = 0; - comline->config_lcrso=DEFAULT_CONFIG_MODULE; - while (cont) { optchar = getopt(argc, argv, OPTION_STRING); @@ -837,6 +835,9 @@ static void decode_arguments(int argc, char *argv[], commandline_t *comline) }; } + if (comline->config_lcrso == NULL) + comline->config_lcrso = strdup(DEFAULT_CONFIG_MODULE); + while (optind < argc) { if (strcmp(argv[optind], "join") == 0) { if (comline->operation)