From e5631087d3862823d0d4854a8dfc1258f91cb115 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 12 Sep 2019 08:34:20 +0000 Subject: tmpfile: give temporary files meaningful names Although we always unlink temporary files, give them a meaningful name so that we can we can still make sense of the pre-unlink name when using lsof(8) or similar tools on Linux. --- lib/PublicInbox/ViewVCS.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/ViewVCS.pm') diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 60a62e57..369afe93 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -20,6 +20,7 @@ use bytes (); # only for bytes::length use PublicInbox::SolverGit; use PublicInbox::WwwStream; use PublicInbox::Linkify; +use PublicInbox::Tmpfile; use PublicInbox::Hval qw(ascii_html to_filename); my $hl = eval { require PublicInbox::HlMod; @@ -185,7 +186,7 @@ sub show ($$;$) { $hints->{$to} = $v; } - open my $log, '+>', undef or die "open: $!"; + my $log = tmpfile("solve.$oid_b"); my $solver = PublicInbox::SolverGit->new($ctx->{-inbox}, sub { solve_result($ctx, $_[0], $log, $hints, $fn); }); -- cgit v1.2.3-24-ge0c7