modify the getipaddr so that it would not warning when can't find the according hostname of a IP.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8400 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
yinle 2010-12-14 13:34:10 +00:00
parent 4934bc649c
commit 9d8a543c65

View File

@ -151,7 +151,9 @@ sub gethostname()
return undef;
}
my $hostname = gethostbyaddr(inet_aton($iporhost), AF_INET);
$hostname =~ s/\..*//; #short hostname
if ( $hostname ) {
$hostname =~ s/\..*//; #short hostname
}
return $hostname;
}
}