Blob Blame History Raw
commit 04710b40794fb31e9cd70c4a205decf6b40206fd
Author: Ryan McCabe <rmccabe@redhat.com>
Date:   Wed Jul 10 17:31:21 2013 -0400

    fence-virt: Fail properly if unable to bind the listener socket
    
    Bail out properly in multicast mode if we're unable to bind the TCP
    listener socket.
    
    Signed-off-by: Ryan McCabe <rmccabe@redhat.com>

diff --git a/client/mcast.c b/client/mcast.c
index ddc1a9c..9ad48ae 100644
--- a/client/mcast.c
+++ b/client/mcast.c
@@ -313,11 +313,14 @@ mcast_fence_virt(fence_virt_args_t *args)
 		if (lfd < 0) {
 			printf("Failed to listen: %s\n", strerror(errno));
 			usleep(args->retr_time * 100000);
-			--attempts;
-			continue;
+			if (--attempts > 0)
+				continue;
 		}
 	} while (0);
 
+	if (lfd < 0)
+		return -1;
+
 	gettimeofday(&tv, NULL);
 	seqno = (uint32_t)tv.tv_usec;