This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: STABLE3 - cman: fix cman_tool build warnings spotted byparanoia cflags
- From: "Fabio M. Di Nitto" <fabbione at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 5 May 2009 07:02:41 +0000 (UTC)
- Subject: cluster: STABLE3 - cman: fix cman_tool build warnings spotted byparanoia cflags
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7c99ca09657285b527405cd7d8d94ff74cb62767
Commit: 7c99ca09657285b527405cd7d8d94ff74cb62767
Parent: 12d624334a1aeece95976ca984564cdfcee20c77
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Tue May 5 09:02:04 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Tue May 5 09:02:04 2009 +0200
cman: fix cman_tool build warnings spotted by paranoia cflags
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
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 bad814a..d6374d5 100644
--- a/cman/cman_tool/cman_tool.h
+++ b/cman/cman_tool/cman_tool.h
@@ -97,6 +97,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 78f8c52..219965e 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 2ccf8ce..08e1397 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -545,9 +545,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:
@@ -752,8 +752,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);
@@ -889,6 +887,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)