user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] lei: hide *_atfork_child from command-line
@ 2021-03-23  6:51 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-03-23  6:51 UTC (permalink / raw)
  To: meta

Otherwise we could get non-sensical results if somebody tries
running "lei atfork_child" from the command-line.
---
 lib/PublicInbox/LEI.pm        | 2 +-
 lib/PublicInbox/LeiConvert.pm | 2 +-
 lib/PublicInbox/LeiInput.pm   | 2 +-
 lib/PublicInbox/LeiMirror.pm  | 2 +-
 lib/PublicInbox/LeiP2q.pm     | 4 ++--
 lib/PublicInbox/LeiStore.pm   | 2 +-
 lib/PublicInbox/LeiToMail.pm  | 2 +-
 lib/PublicInbox/LeiXSearch.pm | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 0be417eb..17ca637e 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -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) {
diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm
index 51a233bd..49e2b7af 100644
--- a/lib/PublicInbox/LeiConvert.pm
+++ b/lib/PublicInbox/LeiConvert.pm
@@ -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);
diff --git a/lib/PublicInbox/LeiInput.pm b/lib/PublicInbox/LeiInput.pm
index 6ad57772..2a4968d4 100644
--- a/lib/PublicInbox/LeiInput.pm
+++ b/lib/PublicInbox/LeiInput.pm
@@ -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;
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index 65818796..c916f2d0 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -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;
 }
diff --git a/lib/PublicInbox/LeiP2q.pm b/lib/PublicInbox/LeiP2q.pm
index 4abe1345..0f7ffb5f 100644
--- a/lib/PublicInbox/LeiP2q.pm
+++ b/lib/PublicInbox/LeiP2q.pm
@@ -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;
 }
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index b5d43b7e..fa03f93c 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -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;
 }
 
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index e9ab939c..1be15707 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -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;
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index b6aaf3e1..c6b82eeb 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-23  6:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23  6:51 [PATCH] lei: hide *_atfork_child from command-line Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.mail.public-inbox.meta
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.mail.public-inbox.meta
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git