Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=70f... Commit: 70fc37ef432d6ec209f64c65f7d2671d86063387 Parent: 8b471e02592d4a0d667981b9821bc622c9545d80 Author: Lon Hohberger lhh@redhat.com AuthorDate: Thu Jul 29 15:53:59 2010 -0400 Committer: Lon Hohberger lhh@redhat.com CommitterDate: Tue Nov 30 13:14:44 2010 -0500
ccsd: Add error when bind fails
Resolves: rhbz#573996
Signed-off-by: Lon Hohberger lhh@redhat.com Reviewed-by: Fabio M. Di Nitto fdinitto@redhat.com --- ccs/daemon/cluster_mgr.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/ccs/daemon/cluster_mgr.c b/ccs/daemon/cluster_mgr.c index 7cfa531..627dc5b 100644 --- a/ccs/daemon/cluster_mgr.c +++ b/ccs/daemon/cluster_mgr.c @@ -364,6 +364,7 @@ static int handle_cluster_event(cman_handle_t handle)
static void cluster_communicator(void) { + char addrbuf[64], *res; int ccsd_fd = -1; int cman_fd = -1; int warn_user = 0; @@ -398,7 +399,12 @@ static void cluster_communicator(void) fcntl(ccsd_fd, F_SETFD, flags);
if (bind(ccsd_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - log_err("Unable to bind to socket.\n"); + res = inet_ntop(AF_INET,&sin.sin_addr, addrbuf, sizeof(addrbuf)); + if (res) { + log_sys_err("Unable to bind socket addr: %s, port: %d, proto: %d", addrbuf, ntohs(sin.sin_port), sin.sin_family); + } else { + log_sys_err("Unable to bind to ipv4 socket, but inet_ntop returned NULL pointer"); + } close(ccsd_fd); exit(EXIT_FAILURE); }