Преглед изворни кода

Remove const warnings from uic system.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1824 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake пре 17 година
родитељ
комит
55ce38d64a
1 измењених фајлова са 10 додато и 5 уклоњено
  1. 10 5
      lcr/uic.c

+ 10 - 5
lcr/uic.c

@@ -57,11 +57,15 @@
 #endif
 #endif
 
 
 #ifdef COROSYNC_LINUX
 #ifdef COROSYNC_LINUX
-static char *socketname = "lcr.socket";
+static const char *socketname = "lcr.socket";
 #else
 #else
-static char *socketname = "/var/run/lcr.socket";
+static const char *socketname = "/var/run/lcr.socket";
 #endif
 #endif
 
 
+static int uic_connect (int *fd);
+
+static int uic_msg_send (int fd, void *msg);
+
 int uic_connect (int *fd)
 int uic_connect (int *fd)
 {
 {
 	int res;
 	int res;
@@ -93,7 +97,7 @@ struct uic_req_msg {
 	char msg[0];
 	char msg[0];
 };
 };
 
 
-int uic_msg_send (int fd, char *msg)
+static int uic_msg_send (int fd, void *msg)
 {
 {
 	struct msghdr msg_send;
 	struct msghdr msg_send;
 	struct iovec iov_send[2];
 	struct iovec iov_send[2];
@@ -104,7 +108,7 @@ int uic_msg_send (int fd, char *msg)
 	req_msg.len = strlen (msg) + 1;
 	req_msg.len = strlen (msg) + 1;
 	iov_send[0].iov_base = (void *)&req_msg;
 	iov_send[0].iov_base = (void *)&req_msg;
 	iov_send[0].iov_len = sizeof (struct uic_req_msg);
 	iov_send[0].iov_len = sizeof (struct uic_req_msg);
-	iov_send[1].iov_base = (void *)msg;
+	iov_send[1].iov_base = msg;
 	iov_send[1].iov_len = req_msg.len;
 	iov_send[1].iov_len = req_msg.len;
 
 
 	msg_send.msg_iov = iov_send;
 	msg_send.msg_iov = iov_send;
@@ -139,12 +143,13 @@ int main (void)
 {
 {
 	int client_fd;
 	int client_fd;
 	int res;
 	int res;
+	char command[128] = "livereplace ckpt version2";
 
 
 	res = uic_connect (&client_fd);
 	res = uic_connect (&client_fd);
 	if (res != 0) {
 	if (res != 0) {
 		printf ("Couldn't connect to live replacement service\n");
 		printf ("Couldn't connect to live replacement service\n");
 	}
 	}
-	uic_msg_send (client_fd, "livereplace ckpt version 2");
+	uic_msg_send (client_fd, (void *)command);
 
 
 	return 0;
 	return 0;
 }
 }