public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - fenced: remove const string warnings
@ 2009-05-12 18:17 David Teigland
0 siblings, 0 replies; only message in thread
From: David Teigland @ 2009-05-12 18:17 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d77119849960b3b477f18879794c2b8f5c30d1db
Commit: d77119849960b3b477f18879794c2b8f5c30d1db
Parent: ed02ac5f4275e1a8e26c8639880e928b747b44f1
Author: David Teigland <teigland@redhat.com>
AuthorDate: Tue May 12 13:09:24 2009 -0500
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Tue May 12 13:09:24 2009 -0500
fenced: remove const string warnings
Signed-off-by: David Teigland <teigland@redhat.com>
---
fence/fenced/config.c | 2 +-
fence/fenced/config.h | 2 +-
fence/fenced/main.c | 13 +++++++------
fence/fenced/member_cman.c | 2 +-
fence/fenced/recover.c | 7 ++++---
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/fence/fenced/config.c b/fence/fenced/config.c
index b9fc1c7..37f98f9 100644
--- a/fence/fenced/config.c
+++ b/fence/fenced/config.c
@@ -24,7 +24,7 @@ int cfgd_skip_undefined = DEFAULT_SKIP_UNDEFINED;
int cfgd_post_join_delay = DEFAULT_POST_JOIN_DELAY;
int cfgd_post_fail_delay = DEFAULT_POST_FAIL_DELAY;
int cfgd_override_time = DEFAULT_OVERRIDE_TIME;
-char *cfgd_override_path = DEFAULT_OVERRIDE_PATH;
+const char *cfgd_override_path = DEFAULT_OVERRIDE_PATH;
void read_ccs_name(const char *path, char *name)
{
diff --git a/fence/fenced/config.h b/fence/fenced/config.h
index e2926e6..f65af0e 100644
--- a/fence/fenced/config.h
+++ b/fence/fenced/config.h
@@ -26,7 +26,7 @@ extern int cfgd_skip_undefined;
extern int cfgd_post_join_delay;
extern int cfgd_post_fail_delay;
extern int cfgd_override_time;
-extern char *cfgd_override_path;
+extern const char *cfgd_override_path;
#endif
diff --git a/fence/fenced/main.c b/fence/fenced/main.c
index 545b50b..5430afe 100644
--- a/fence/fenced/main.c
+++ b/fence/fenced/main.c
@@ -13,6 +13,7 @@ static struct pollfd *pollfd = NULL;
static pthread_t query_thread;
static pthread_mutex_t query_mutex;
static struct list_head controlled_entries;
+static char default_name[8];
struct client {
int fd;
@@ -335,7 +336,7 @@ static void query_node_info(int f, int data_nodeid)
struct fenced_node node;
int nodeid, rv;
- fd = find_fd("default");
+ fd = find_fd(default_name);
if (!fd) {
rv = -ENOENT;
goto out;
@@ -360,7 +361,7 @@ static void query_domain_info(int f)
struct fenced_domain domain;
int rv;
- fd = find_fd("default");
+ fd = find_fd(default_name);
if (!fd) {
rv = -ENOENT;
goto out;
@@ -384,7 +385,7 @@ static void query_domain_nodes(int f, int option, int max)
struct fenced_node *nodes = NULL;
int rv, result;
- fd = find_fd("default");
+ fd = find_fd(default_name);
if (!fd) {
result = -ENOENT;
node_count = 0;
@@ -423,11 +424,9 @@ static void query_domain_nodes(int f, int option, int max)
static void process_connection(int ci)
{
struct fenced_header h;
- char default_name[8];
char *extra = NULL;
int rv, extra_len;
- strcpy(default_name, "default");
rv = do_read(client[ci].fd, &h, sizeof(h));
if (rv < 0) {
@@ -624,7 +623,7 @@ struct controlled_entry {
char path[PATH_MAX+1];
};
-static void register_controlled_dir(char *path)
+static void register_controlled_dir(const char *path)
{
struct controlled_entry *ce;
@@ -1028,6 +1027,8 @@ int main(int argc, char **argv)
INIT_LIST_HEAD(&domains);
INIT_LIST_HEAD(&controlled_entries);
+ strcpy(default_name, "default");
+
read_arguments(argc, argv);
if (!daemon_debug_opt) {
diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c
index 4b9722d..2f9dbb6 100644
--- a/fence/fenced/member_cman.c
+++ b/fence/fenced/member_cman.c
@@ -97,7 +97,7 @@ char *nodeid_to_name(int nodeid)
if (cn)
return cn->cn_name;
- return "unknown";
+ return NULL;
}
int name_to_nodeid(char *name)
diff --git a/fence/fenced/recover.c b/fence/fenced/recover.c
index 82e1427..e956e83 100644
--- a/fence/fenced/recover.c
+++ b/fence/fenced/recover.c
@@ -80,7 +80,7 @@ static int reduce_victims(struct fd *fd)
return num_victims;
}
-static inline void close_override(int *fd, char *path)
+static inline void close_override(int *fd, const char *path)
{
unlink(path);
if (fd) {
@@ -90,7 +90,7 @@ static inline void close_override(int *fd, char *path)
}
}
-static int open_override(char *path)
+static int open_override(const char *path)
{
int ret;
mode_t om;
@@ -244,7 +244,8 @@ void defer_fencing(struct fd *fd)
master_name = nodeid_to_name(fd->master);
- log_level(LOG_INFO, "fencing deferred to %s", master_name);
+ log_level(LOG_INFO, "fencing deferred to %s",
+ master_name ? master_name : "unknown");
}
static const char *fe_str(int r)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-12 18:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 18:17 cluster: STABLE3 - fenced: remove const string warnings David Teigland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).