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

Re: [Libguestfs] [PATCH] ExecHelper: Code cleanup



On Mon, Mar 08, 2010 at 02:14:29PM +0000, Matthew Booth wrote:
> ---
>  lib/Sys/VirtV2V/ExecHelper.pm |   18 +++++-------------
>  1 files changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/lib/Sys/VirtV2V/ExecHelper.pm b/lib/Sys/VirtV2V/ExecHelper.pm
> index 87f6d06..110ae9f 100644
> --- a/lib/Sys/VirtV2V/ExecHelper.pm
> +++ b/lib/Sys/VirtV2V/ExecHelper.pm
> @@ -68,25 +68,17 @@ sub run
>      my $self = {};
>      bless($self, $class);
>  
> -    $self->{output} = File::Temp->new();
> -    $self->{status} = $self->_run(@command);
> -
> -    return $self;
> -}
> -
> -sub _run
> -{
> -    my $self = shift;
> -    my @command = @_;
> -
> -    my $output = $self->{output};
> -
>      my $null;
>      open($null, '<', '/dev/null') or die("Failed to open /dev/null: $!");
>  
> +    my $output = File::Temp->new();
>      my $pid = open3($null, $output, $output, @command);
>      waitpid($pid, 0);
> +
>      $self->{status} = $? >> 8;
> +    $self->{output} = $output;
> +
> +    return $self;
>  }
>  
>  =item status
> -- 
> 1.6.6.1

Yup, seems pretty obvious, ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top


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