From: Richard Jones Date: Sun, 11 Jul 2010 22:11:08 +0000 (+0100) Subject: edit: Clean up temporary files. X-Git-Tag: 1.2.10~2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=a0c41d127ded25754b4fee38ef57b8b333fedbca;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.2 branch: - Cherry picked from commit 10ea14a3f1adb7023dd0601e4759bd24a030a1c3 - Rebase. --- 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);