Matthew Booth
2010-Mar-08 17:05 UTC
[Libguestfs] [PATCH] ExecHelper: Use tmpfile() instead of File::Temp->new()
Building on EL-5 fails when the result of File::Temp->new() is passed to open3(). tmpfile() works consistently. --- lib/Sys/VirtV2V/ExecHelper.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sys/VirtV2V/ExecHelper.pm b/lib/Sys/VirtV2V/ExecHelper.pm index 110ae9f..f577ff6 100644 --- a/lib/Sys/VirtV2V/ExecHelper.pm +++ b/lib/Sys/VirtV2V/ExecHelper.pm @@ -20,7 +20,7 @@ package Sys::VirtV2V::ExecHelper; use strict; use warnings; -use File::Temp; +use File::Temp qw(:POSIX); use IPC::Open3; use POSIX ":sys_wait_h"; @@ -71,7 +71,7 @@ sub run my $null; open($null, '<', '/dev/null') or die("Failed to open /dev/null: $!"); - my $output = File::Temp->new(); + my $output = tmpfile(); my $pid = open3($null, $output, $output, @command); waitpid($pid, 0); -- 1.6.6.1
Richard W.M. Jones
2010-Mar-09 09:54 UTC
[Libguestfs] [PATCH] ExecHelper: Use tmpfile() instead of File::Temp->new()
On Mon, Mar 08, 2010 at 05:05:15PM +0000, Matthew Booth wrote:> Building on EL-5 fails when the result of File::Temp->new() is passed to > open3(). tmpfile() works consistently. > --- > lib/Sys/VirtV2V/ExecHelper.pm | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/Sys/VirtV2V/ExecHelper.pm b/lib/Sys/VirtV2V/ExecHelper.pm > index 110ae9f..f577ff6 100644 > --- a/lib/Sys/VirtV2V/ExecHelper.pm > +++ b/lib/Sys/VirtV2V/ExecHelper.pm > @@ -20,7 +20,7 @@ package Sys::VirtV2V::ExecHelper; > use strict; > use warnings; > > -use File::Temp; > +use File::Temp qw(:POSIX); > use IPC::Open3; > use POSIX ":sys_wait_h"; > > @@ -71,7 +71,7 @@ sub run > my $null; > open($null, '<', '/dev/null') or die("Failed to open /dev/null: $!"); > > - my $output = File::Temp->new(); > + my $output = tmpfile(); > my $pid = open3($null, $output, $output, @command); > waitpid($pid, 0);Seems OK. No idea why it's failing though. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Possibly Parallel Threads
- [PATCH] ExecHelper: Code cleanup
- [PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
- Create new Sys::VirtV2V::Util
- [PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections
- [PATCH] Improve cleanup of libguestfs handle with Sys::VirtV2V::GuestfsHandle