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

Re: [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


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