From: Richard Jones Date: Sun, 11 Jul 2010 22:11:08 +0000 (+0100) Subject: edit: Clean up temporary files. X-Git-Tag: 1.4.1~2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=c94c97db6c980592aef3f1b4b73a90a8b4ecc47a;p=libguestfs.git edit: Clean up temporary files. Note to self: The 'tempfile' function does *not* default to removing files with the program exits! For stable-1.4 branch: - Cherry picked from commit 10ea14a3f1adb7023dd0601e4759bd24a030a1c3 - Rebased --- diff --git a/tools/virt-edit b/tools/virt-edit index e00e4cf..ca8e576 100755 --- a/tools/virt-edit +++ b/tools/virt-edit @@ -139,7 +139,7 @@ my $root_dev = $roots[0]; my $os = $oses->{$root_dev}; mount_operating_system ($g, $os, 0); -my ($fh, $tempname) = tempfile (); +my ($fh_not_used, $tempname) = tempfile (UNLINK => 1); # Allow this to fail in case eg. the file does not exist. $g->download($filename, $tempname);