about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-26 08:12:52 +0000
committerEric Wong <e@80x24.org>2020-12-26 20:20:13 +0000
commitb782533a0413578de4cfd478c67a8e3d9dda0949 (patch)
treed3c494e9769a6c4c483e38c9d2305f46257cc43b
parent4f1a683dc895a7bd4cf79e58b39faea256045921 (diff)
downloadpublic-inbox-b782533a0413578de4cfd478c67a8e3d9dda0949.tar.gz
->on_inbox_unlock callbacks could clobber $_, and this seems to
fix a problem with -extindex --watch failing to index some
inboxes after SIGHUP reload.

(cherry picked from commit b5e960f50289434025f5904c8c1311e4c8a02b82)
-rw-r--r--lib/PublicInbox/Inbox.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index b0894a7d..e9efd29d 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -422,8 +422,8 @@ sub on_unlock {
         my ($self) = @_;
         check_inodes($self);
         my $subs = $self->{unlock_subs} or return;
-        for (values %$subs) {
-                eval { $_->on_inbox_unlock($self) };
+        for my $obj (values %$subs) {
+                eval { $obj->on_inbox_unlock($self) };
                 warn "E: $@ ($self->{inboxdir})\n" if $@;
         }
 }