diff options
Diffstat (limited to 'tools/virt-edit')
-rwxr-xr-x | tools/virt-edit | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/virt-edit b/tools/virt-edit index 887ef4b6..78316fd0 100755 --- a/tools/virt-edit +++ b/tools/virt-edit @@ -198,10 +198,13 @@ my $root_dev = $roots[0]; my $os = $oses->{$root_dev}; mount_operating_system ($g, $os, 0); -my ($fh_not_used, $tempname) = tempfile (UNLINK => 1); +my ($fh, $tempname) = tempfile (UNLINK => 1); +my $fddev = "/dev/fd/" . fileno ($fh); # Allow this to fail in case eg. the file does not exist. -$g->download($filename, $tempname); +$g->download ($filename, $fddev); + +close $fh or die "close: $!"; my $do_upload = $tempname; @@ -232,7 +235,7 @@ if (!defined $expr) { die if $@; print $fh $_ or die "print: $!"; } - close $fh; + close $fh or die "close: $!"; $do_upload = $tempout; } |