[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [OSSTEST PATCH] DhcpWatch::leases: Check errors



On Fri, 2014-10-31 at 11:21 +0000, Ian Jackson wrote:
> Check error returns from connect() et al (which present as an undef
> return from IO::Socket::INET), and from read() (which can be detected
> via IO::Handle::error).
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Looks like you have a mixture of tabs and spaces in the second hunk, but
otherwise:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  Osstest/DhcpWatch/leases.pm |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Osstest/DhcpWatch/leases.pm b/Osstest/DhcpWatch/leases.pm
> index 6f142e7..9a74c40 100644
> --- a/Osstest/DhcpWatch/leases.pm
> +++ b/Osstest/DhcpWatch/leases.pm
> @@ -58,6 +58,7 @@ sub check_ip ($$) {
>       if (!defined $leases) { return "open $leasesfn: $!"; }
>      } else {
>       $leases= new IO::Socket::INET(PeerAddr => $leasesfn);
> +     if (!defined $leases) { return "connect to $leasesfn: $!"; }
>      }
>  
>      my $lstash= "dhcpleases-$gho->{Guest}";
> @@ -163,6 +164,9 @@ sub check_ip ($$) {
>  
>      if (!$best) {
>          $saveas->("$lstash.nolease", 3);
> +     if ($leases->error) {
> +         return "error reading $leasesfn";
> +     }
>          return "no active lease";
>      }
>      $gho->{Ip}= $best->{' addr'};



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.