dlm: master - dlm_controld: fix const warning

Fabio M. Di Nitto fabbione@fedoraproject.org
Tue Jun 23 09:01:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=2bf8cb38efd6802e0989726626d86907e4095993
Commit:        2bf8cb38efd6802e0989726626d86907e4095993
Parent:        58f2dce9718a4d79c866048c4aa6cb8fa5cae9dc
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Wed May 6 08:36:08 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Tue Jun 23 10:46:47 2009 +0200

dlm_controld: fix const warning

several of those

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 group/dlm_controld/action.c     |   11 ++++++-----
 group/dlm_controld/config.c     |    8 ++++----
 group/dlm_controld/cpg.c        |    2 +-
 group/dlm_controld/deadlock.c   |    2 +-
 group/dlm_controld/dlm_daemon.h |   10 +++++-----
 group/dlm_controld/main.c       |    4 ++--
 group/dlm_controld/plock.c      |    4 ++--
 7 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/group/dlm_controld/action.c b/group/dlm_controld/action.c
index e4180d4..229823b 100644
--- a/group/dlm_controld/action.c
+++ b/group/dlm_controld/action.c
@@ -18,7 +18,8 @@ static char mg_name[DLM_LOCKSPACE_LEN+1];
 static int get_mountgroup_name(uint32_t mg_id)
 {
 	char path[PATH_MAX];
-	char *fsname, *fsdir;
+	char *fsname;
+	const char *fsdir;
 	DIR *d;
 	FILE *file;
 	struct dirent *de;
@@ -153,7 +154,7 @@ void set_associated_id(uint32_t mg_id)
 	ls->associated_mg_id = mg_id;
 }
 
-static int do_sysfs(char *name, char *file, char *val)
+static int do_sysfs(const char *name, const char *file, char *val)
 {
 	char fname[512];
 	int rv, fd;
@@ -246,7 +247,7 @@ static int id_exists(int id, int count, int *array)
 	return 0;
 }
 
-static int create_path(char *path)
+static int create_path(const char *path)
 {
 	mode_t old_umask;
 	int rv;
@@ -685,7 +686,7 @@ int add_configfs_node(int nodeid, char *addr, int addrlen, int local)
 		return -1;
 	}
 
-	rv = do_write(fd, "1", strlen("1"));
+	rv = do_write(fd, (void *)"1", strlen("1"));
 	if (rv < 0) {
 		log_error("%s: write failed: %d", path, errno);
 		close(fd);
@@ -877,7 +878,7 @@ static void find_minors(void)
 		log_error("Is dlm missing from kernel? No misc devices found.");
 }
 
-static int find_udev_device(char *path, uint32_t minor)
+static int find_udev_device(const char *path, uint32_t minor)
 {
 	struct stat st;
 	int i;
diff --git a/group/dlm_controld/config.c b/group/dlm_controld/config.c
index fb75eee..548b47a 100644
--- a/group/dlm_controld/config.c
+++ b/group/dlm_controld/config.c
@@ -170,7 +170,7 @@ int get_weight(int nodeid, char *lockspace)
 	return w;
 }
 
-void read_ccs_name(char *path, char *name)
+void read_ccs_name(const char *path, char *name)
 {
 	char *str;
 	int error;
@@ -184,7 +184,7 @@ void read_ccs_name(char *path, char *name)
 	free(str);
 }
 
-void read_ccs_yesno(char *path, int *yes, int *no)
+void read_ccs_yesno(const char *path, int *yes, int *no)
 {
 	char *str;
 	int error;
@@ -205,7 +205,7 @@ void read_ccs_yesno(char *path, int *yes, int *no)
 	free(str);
 }
 
-int read_ccs_int(char *path, int *config_val)
+int read_ccs_int(const char *path, int *config_val)
 {
 	char *str;
 	int val;
@@ -228,7 +228,7 @@ int read_ccs_int(char *path, int *config_val)
 	return 0;
 }
 
-static void read_ccs_protocol(char *path, int *config_val)
+static void read_ccs_protocol(const char *path, int *config_val)
 {
 	char *str;
 	int val;
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 43b36fd..a33687a 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -129,7 +129,7 @@ static void ids_in(struct ls_info *li, struct id_info *ids)
 	}
 }
 
-char *msg_name(int type)
+const char *msg_name(int type)
 {
 	switch (type) {
 	case DLM_MSG_PROTOCOL:
diff --git a/group/dlm_controld/deadlock.c b/group/dlm_controld/deadlock.c
index 4671c8c..bd1d68c 100644
--- a/group/dlm_controld/deadlock.c
+++ b/group/dlm_controld/deadlock.c
@@ -97,7 +97,7 @@ static inline int dlm_modes_compat(int mode1, int mode2)
 	return __dlm_compat_matrix[mode1 + 1][mode2 + 1];
 }
 
-static char *status_str(int lksts)
+static const char *status_str(int lksts)
 {
 	switch (lksts) {
 	case DLM_LKSTS_WAITING:
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index 8e484d7..018f8c8 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -216,9 +216,9 @@ int setup_misc_devices(void);
 /* config.c */
 int setup_ccs(void);
 void close_ccs(void);
-void read_ccs_name(char *path, char *name);
-void read_ccs_yesno(char *path, int *yes, int *no);
-int read_ccs_int(char *path, int *config_val);
+void read_ccs_name(const char *path, char *name);
+void read_ccs_yesno(const char *path, int *yes, int *no);
+int read_ccs_int(const char *path, int *config_val);
 int get_weight(int nodeid, char *lockspace);
 
 /* cpg.c */
@@ -230,7 +230,7 @@ void process_lockspace_changes(void);
 void dlm_send_message(struct lockspace *ls, char *buf, int len);
 int dlm_join_lockspace(struct lockspace *ls);
 int dlm_leave_lockspace(struct lockspace *ls);
-char *msg_name(int type);
+const char *msg_name(int type);
 void update_flow_control_status(void);
 int set_node_info(struct lockspace *ls, int nodeid, struct dlmc_node *node);
 int set_lockspace_info(struct lockspace *ls, struct dlmc_lockspace *lockspace);
@@ -265,7 +265,7 @@ void client_ignore(int ci, int fd);
 void client_back(int ci, int fd);
 struct lockspace *find_ls(char *name);
 struct lockspace *find_ls_id(uint32_t id);
-char *dlm_mode_str(int mode);
+const char *dlm_mode_str(int mode);
 void cluster_dead(int ci);
 
 /* member_cman.c */
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index a3cf7b4..ba46753 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -268,7 +268,7 @@ static char *get_args(char *buf, int *argc, char **argv, char sep, int want)
 	return rp;
 }
 
-char *dlm_mode_str(int mode)
+const char *dlm_mode_str(int mode)
 {
 	switch (mode) {
 	case DLM_LOCK_IV:
@@ -691,7 +691,7 @@ static void process_listener(int ci)
 	log_debug("client connection %d fd %d", i, fd);
 }
 
-static int setup_listener(char *sock_path)
+static int setup_listener(const char *sock_path)
 {
 	struct sockaddr_un addr;
 	socklen_t addrlen;
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 957d749..86e8336 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -114,7 +114,7 @@ static void info_bswap_in(struct dlm_plock_info *i)
 	i->owner	= le64_to_cpu(i->owner);
 }
 
-static char *op_str(int optype)
+static const char *op_str(int optype)
 {
 	switch (optype) {
 	case DLM_PLOCK_OP_LOCK:
@@ -128,7 +128,7 @@ static char *op_str(int optype)
 	}
 }
 
-static char *ex_str(int optype, int ex)
+static const char *ex_str(int optype, int ex)
 {
 	if (optype == DLM_PLOCK_OP_UNLOCK || optype == DLM_PLOCK_OP_GET)
 		return "-";



More information about the Cluster-cvs mailing list