Lib.pm: Use Perl backtick instead of slurp (Aron Griffis).
authorRichard Jones <rjones@trick.home.annexia.org>
Wed, 29 Jul 2009 14:33:22 +0000 (15:33 +0100)
committerRichard Jones <rjones@trick.home.annexia.org>
Wed, 29 Jul 2009 14:33:22 +0000 (15:33 +0100)
perl/lib/Sys/Guestfs/Lib.pm

index 1e5638e..7a734aa 100644 (file)
@@ -440,9 +440,7 @@ sub file_architecture
 
        foreach my $bin (@_initrd_binaries) {
            if (-f "$dir/bin/$bin") {
 
        foreach my $bin (@_initrd_binaries) {
            if (-f "$dir/bin/$bin") {
-               open PIPE, "file $dir/bin/$bin |";
-               local $/ = undef;
-               $_ = <PIPE>;
+               $_ = `file $dir/bin/$bin`;
                if (/ELF.*executable, (.+?),/) {
                    return _elf_arch_to_canonical ($1);
                }
                if (/ELF.*executable, (.+?),/) {
                    return _elf_arch_to_canonical ($1);
                }