[Sheepdog] [PATCH 01/12] const correctness: connect_to() 1st parameter is really a const char *

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Fri May 21 13:42:28 CEST 2010


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 include/net.h |    2 +-
 lib/net.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net.h b/include/net.h
index 63ae469..b0bc399 100644
--- a/include/net.h
+++ b/include/net.h
@@ -31,7 +31,7 @@ int is_conn_dead(struct connection *conn);
 int do_read(int sockfd, void *buf, int len);
 int rx(struct connection *conn, enum conn_state next_state);
 int tx(struct connection *conn, enum conn_state next_state, int flags);
-int connect_to(char *name, int port);
+int connect_to(const char *name, int port);
 int send_req(int sockfd, struct sd_req *hdr, void *data, unsigned int *wlen);
 int exec_req(int sockfd, struct sd_req *hdr, void *data,
 	     unsigned int *wlen, unsigned int *rlen);
diff --git a/lib/net.c b/lib/net.c
index 24c9bbf..2459a0c 100644
--- a/lib/net.c
+++ b/lib/net.c
@@ -177,7 +177,7 @@ int create_listen_ports(int port, int (*callback)(int fd, void *), void *data)
 	return !success;
 }
 
-int connect_to(char *name, int port)
+int connect_to(const char *name, int port)
 {
 	char buf[64];
 	char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
-- 
1.5.6.5




More information about the sheepdog mailing list