From 1fc59b952c8e9618abad4ec52888e43f55b8ab77 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 7 Apr 2023 12:40:50 +0000 Subject: umask: hoist out of InboxWritable Since CodeSearchIdx doesn't deal with inboxes, it makes sense to split it out from inbox-specific code and start moving towards using OnDestroy to restore the umask at the end of scope and reducing extra functions. --- lib/PublicInbox/SearchIdx.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 699af432..69ab30e6 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -9,7 +9,8 @@ package PublicInbox::SearchIdx; use strict; use v5.10.1; -use parent qw(PublicInbox::Search PublicInbox::Lock Exporter); +use parent qw(PublicInbox::Search PublicInbox::Lock PublicInbox::Umask + Exporter); use PublicInbox::Eml; use PublicInbox::Search qw(xap_terms); use PublicInbox::InboxWritable; @@ -821,7 +822,8 @@ sub unindex_both { # git->cat_async callback sub with_umask { my $self = shift; - ($self->{ibx} // $self->{eidx})->with_umask(@_); + my $owner = $self->{ibx} // $self->{eidx}; + $owner ? $owner->with_umask(@_) : $self->SUPER::with_umask(@_) } # called by public-inbox-index -- cgit v1.2.3-24-ge0c7