From 45edb4b5e13c5f030e776577045386f11c797c6c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 9 Nov 2023 10:09:35 +0000 Subject: lei: use cached $daemon_pid when possible ->lei_daemon_pid can only be called in the top-level daemon process when $daemon_pid is valid, so avoid a getpid(2) syscall in those cases. --- lib/PublicInbox/LEI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/LEI.pm') diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 2832db63..f32e5bbc 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -927,7 +927,7 @@ sub _config { run_wait($cmd, \%env, \%opt) ? ($err_ok ? undef : fail($self, $?)) : 1; } -sub lei_daemon_pid { puts shift, $$ } +sub lei_daemon_pid { puts shift, $daemon_pid } sub lei_daemon_kill { my ($self) = @_; -- cgit v1.2.3-24-ge0c7