From 476f9f7b944ce257008873baa6da25f14b1f799a Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 28 Nov 2014 06:57:36 -0500 Subject: [PATCH] defect 4442: fix the issue in xcatd that new UDP won't exit with error message when it cannot get socket during the xcatd fast restart --- xCAT-server/sbin/xcatd | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 2dbb8fed8..fb1bec30b 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -650,19 +650,20 @@ sub do_udp_service { #This function opens up a UDP port } close($udppidfile); } - my $select = new IO::Select; -while (not $socket and $retry) { -if ($inet6support) { - $socket = IO::Socket::INET6->new(LocalPort => $port, + my $select = new IO::Select; + while (not $socket and $retry) { + $retry--; + if ($inet6support) { + $socket = IO::Socket::INET6->new(LocalPort => $port, Proto => 'udp', ); -} else { - $socket = IO::Socket::INET->new(LocalPort => $port, + } else { + $socket = IO::Socket::INET->new(LocalPort => $port, Proto => 'udp', Domain => AF_INET); -} -sleep 0.05; -} + } + sleep 0.05; + } openlog("xCAT UDP",'','local4'); unless ($socket) {