Changeset 85462fb
- Timestamp:
- May 25, 2010 5:39:21 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 479a7d9
- Parents:
- acaa9b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/gateway_lib.pm
racaa9b9 r85462fb 20 20 use File::Temp; 21 21 use File::Copy; 22 use Net::hostent; 22 23 23 24 # Standard locations of these commands (FreeBSD) … … 77 78 my $start = time(); 78 79 $sleep = 5 unless $sleep; 79 my @rv;80 81 while (! @rv) {82 @rv = gethostbyname($name);80 my $rv; 81 82 while (!$rv) { 83 $rv = gethostbyname($name); 83 84 die "Timeout waiting for DNS to get $name\n" 84 85 if ($timeout && time() - $start > $timeout); 85 sleep($sleep) unless @rv;86 sleep($sleep) unless $rv; 86 87 } 87 88 } … … 438 439 } 439 440 441 sub get_ip { 442 my($name) = @_; 443 my $gwip; 444 if ( my $hent = gethostbyname($name) ) { 445 $gwip = inet_ntoa($hent->addr_list->[0]); 446 } 447 return $gwip; 448 } 449 440 450 1;
Note: See TracChangeset
for help on using the changeset viewer.