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:
parent
4934bc649c
commit
9d8a543c65
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user