From 34bc77692cb57a13dda5b8e7ea1c43fbccfec0af Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Thu, 29 Mar 2018 20:17:20 +0000 Subject: mda: support v2 inboxes I mainly focus on -watch for mirroring busy mailing lists, but using -mda should remain an option. --- lib/PublicInbox/Emergency.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Emergency.pm') diff --git a/lib/PublicInbox/Emergency.pm b/lib/PublicInbox/Emergency.pm index 231b4197..66adc631 100644 --- a/lib/PublicInbox/Emergency.pm +++ b/lib/PublicInbox/Emergency.pm @@ -18,7 +18,7 @@ sub new { next if -d $d; -d $d or mkdir($d) or die "failed to mkdir($d): $!\n"; } - bless { dir => $dir, files => {}, t => 0, cnt => 0 }, $class; + bless { dir => $dir, files => {}, t => 0, cnt => 0, pid => $$ }, $class; } sub _fn_in { @@ -75,6 +75,7 @@ sub fh { sub commit { my ($self) = @_; + $$ == $self->{pid} or return; # no-op in forked child delete $self->{fh}; my $tmp = delete $self->{tmp} or return; -- cgit v1.2.3-24-ge0c7