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

[Libguestfs] [PATCH] ExecHelper: Code cleanup



---
 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


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