]> Sergey Matveev's repositories - public-inbox.git/commitdiff
edit: unlink temporary file when done
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Tue, 11 Jun 2019 18:34:58 +0000 (18:34 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 12 Jun 2019 00:23:29 +0000 (00:23 +0000)
We don't need to leave temporary files lying around.

script/public-inbox-edit

index 16d785294f49bcb79a62620af2a5548437ba508c..2e2c761620e154da65a395f6d9c6a12a756cb14f 100755 (executable)
@@ -121,7 +121,7 @@ $mids
 
 my $tmpl = 'public-inbox-edit-XXXXXX';
 foreach my $to_edit (values %$found) {
-       my ($edit_fh, $edit_fn) = tempfile($tmpl, TMPDIR => 1);
+       my ($edit_fh, $edit_fn) = tempfile($tmpl, TMPDIR => 1, UNLINK => 1);
        $edit_fh->autoflush(1);
        my ($ibx, $smsg) = @{$to_edit->[0]};
        my $old_raw = $ibx->msg_by_smsg($smsg);