summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-07-11 23:11:08 +0100
committerRichard Jones <rjones@redhat.com>2010-07-11 23:11:08 +0100
commit10ea14a3f1adb7023dd0601e4759bd24a030a1c3 (patch)
tree5f0c12472d88bec5c10e3256dcff9953b79455af /tools
parentfed8714b92b57da1a593f74b52635fd267442d5b (diff)
downloadlibguestfs-10ea14a3f1adb7023dd0601e4759bd24a030a1c3.tar.gz
libguestfs-10ea14a3f1adb7023dd0601e4759bd24a030a1c3.tar.xz
libguestfs-10ea14a3f1adb7023dd0601e4759bd24a030a1c3.zip
edit: Clean up temporary files.
Note to self: The 'tempfile' function does *not* default to removing files with the program exits!
Diffstat (limited to 'tools')
-rwxr-xr-xtools/virt-edit4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/virt-edit b/tools/virt-edit
index 154d3363..128872e8 100755
--- a/tools/virt-edit
+++ b/tools/virt-edit
@@ -180,7 +180,7 @@ my $root_dev = $roots[0];
my $os = $oses->{$root_dev};
mount_operating_system ($g, $os, 0);
-my ($fh_not_used, $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);
@@ -203,7 +203,7 @@ if (!defined $expr) {
print __"File not changed.\n";
}
} else {
- my ($fh, $tempout) = tempfile ();
+ my ($fh, $tempout) = tempfile (UNLINK => 1);
# Apply a Perl expression to the lines of the file.
open IFILE, $tempname or die "$tempname: $!";