[PATCH] ctdb: remove bogus error logging, avoid cast.

Rusty Russell rusty at rustcorp.com.au
Fri Oct 23 03:03:13 MDT 2009


Returning 0 is the success case for bind.

Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---
 tcp/tcp_connect.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tcp/tcp_connect.c b/tcp/tcp_connect.c
index c74487b..9520aae 100644
--- a/tcp/tcp_connect.c
+++ b/tcp/tcp_connect.c
@@ -352,8 +352,7 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
 
 	        setsockopt(ctcp->listen_fd,SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one));
 
-		if (bind(ctcp->listen_fd, (struct sockaddr * )&sock, sock_size) == 0) {
-			DEBUG(DEBUG_ERR,(__location__ " Failed to bind() to socket. %s(%d)\n", strerror(errno), errno));
+		if (bind(ctcp->listen_fd, &sock.sa, sock_size) == 0) {
 			break;
 		}
 	}
-- 
1.6.0.4



More information about the samba-technical mailing list