]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: hide *_atfork_child from command-line
authorEric Wong <e@80x24.org>
Tue, 23 Mar 2021 06:51:41 +0000 (04:51 -0200)
committerEric Wong <e@80x24.org>
Wed, 24 Mar 2021 01:33:26 +0000 (01:33 +0000)
Otherwise we could get non-sensical results if somebody tries
running "lei atfork_child" from the command-line.

lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiConvert.pm
lib/PublicInbox/LeiInput.pm
lib/PublicInbox/LeiMirror.pm
lib/PublicInbox/LeiP2q.pm
lib/PublicInbox/LeiStore.pm
lib/PublicInbox/LeiToMail.pm
lib/PublicInbox/LeiXSearch.pm

index 0be417ebae524338af023c519d412e4909417782..17ca637eb304fd6d2fc246e38976aea4bd60319d 100644 (file)
@@ -449,7 +449,7 @@ sub note_sigpipe { # triggers sigpipe_handler
        x_it($self, 13);
 }
 
-sub lei_atfork_child {
+sub _lei_atfork_child {
        my ($self, $persist) = @_;
        # we need to explicitly close things which are on stack
        if ($persist) {
index 51a233bd08a92356fd96ca3a2ecd2b4b3a5b3933..49e2b7af2e7b915ba8e8029a80be9f2ae381f8b9 100644 (file)
@@ -86,7 +86,7 @@ sub lei_convert { # the main "lei convert" method
 sub ipc_atfork_child {
        my ($self) = @_;
        my $lei = $self->{lei};
-       $lei->lei_atfork_child;
+       $lei->_lei_atfork_child;
        my $l2m = delete $lei->{l2m};
        if (my $net = $lei->{net}) { # may prompt user once
                $net->{mics_cached} = $net->imap_common_init($lei);
index 6ad5777207fdf1ad1a13547ec2b7125dc70200ac..2a4968d416e6b1f00dcc7e957e1b749263293cc4 100644 (file)
@@ -106,7 +106,7 @@ sub prepare_inputs { # returns undef on error
 sub input_only_atfork_child {
        my ($self) = @_;
        my $lei = $self->{lei};
-       $lei->lei_atfork_child;
+       $lei->_lei_atfork_child;
        PublicInbox::IPC::ipc_atfork_child($self);
        $lei->{auth}->do_auth_atfork($self) if $lei->{auth};
        undef;
index 658187960271c9f57e64637f65484b1575eb6bb9..c916f2d007800048abe2707cca1274cb3c93b0ce 100644 (file)
@@ -288,7 +288,7 @@ sub start {
 
 sub ipc_atfork_child {
        my ($self) = @_;
-       $self->{lei}->lei_atfork_child;
+       $self->{lei}->_lei_atfork_child;
        $SIG{TERM} = sub { exit(128 + 15) }; # trigger OnDestroy $reap
        $self->SUPER::ipc_atfork_child;
 }
index 4abe1345d041336a723e9651f7acf2a4ceac1646..0f7ffb5f3daa8b93e9752999ec65fd67836ab0d9 100644 (file)
@@ -178,7 +178,7 @@ sub lei_p2q { # the "lei patch-to-query" entry point
        my ($lei, $input) = @_;
        my $self = $lei->{p2q} = bless {}, __PACKAGE__;
        if ($lei->{opt}->{stdin}) {
-               $self->{0} = delete $lei->{0}; # guard from lei_atfork_child
+               $self->{0} = delete $lei->{0}; # guard from _lei_atfork_child
        } else {
                $self->{input} = $input;
        }
@@ -191,7 +191,7 @@ sub lei_p2q { # the "lei patch-to-query" entry point
 sub ipc_atfork_child {
        my ($self) = @_;
        my $lei = $self->{lei};
-       $lei->lei_atfork_child;
+       $lei->_lei_atfork_child;
        $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb();
        $self->SUPER::ipc_atfork_child;
 }
index b5d43b7eea125a94e71168490baed27cb2867e8e..fa03f93c93aa3a8895c478c055e1676c21263442 100644 (file)
@@ -322,7 +322,7 @@ sub done {
 sub ipc_atfork_child {
        my ($self) = @_;
        my $lei = $self->{lei};
-       $lei->lei_atfork_child(1) if $lei;
+       $lei->_lei_atfork_child(1) if $lei;
        $self->SUPER::ipc_atfork_child;
 }
 
index e9ab939cd659df167f8a8cf6ea93e9be9a162697..1be15707ac19ee305a6dab2a62a8c849aeba0c1f 100644 (file)
@@ -636,7 +636,7 @@ sub do_post_auth {
 sub ipc_atfork_child {
        my ($self) = @_;
        my $lei = $self->{lei};
-       $lei->lei_atfork_child;
+       $lei->_lei_atfork_child;
        $lei->{auth}->do_auth_atfork($self) if $lei->{auth};
        $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb();
        $self->SUPER::ipc_atfork_child;
index b6aaf3e136d4fa07c7bccc1f693c21a3a5329a04..c6b82eeb5bcf31cf285c451f4b163b730e950bd2 100644 (file)
@@ -401,7 +401,7 @@ sub incr_start_query { # called whenever an l2m shard starts do_post_auth
 
 sub ipc_atfork_child {
        my ($self) = @_;
-       $self->{lei}->lei_atfork_child;
+       $self->{lei}->_lei_atfork_child;
        $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb();
        $self->SUPER::ipc_atfork_child;
 }