diff options
author | Eric Wong <e@80x24.org> | 2023-01-29 09:45:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-30 06:42:26 +0000 |
commit | 9eb8baf199cd148b7ebf8e6e130fb832f4e1ef00 (patch) | |
tree | b89b0cc4e444c2f673902aa3b9605940b04380bc /lib/PublicInbox/SpawnPP.pm | |
parent | 4a2e1f38e75ef3ce8bffc8f2b59b18b32420c0fc (diff) | |
download | public-inbox-9eb8baf199cd148b7ebf8e6e130fb832f4e1ef00.tar.gz |
I have no idea if mod_perl/mod_perl2 is used nowadays, but we're stuck supporting it as long as mod_perl exists. So add some tests and make minor updates to existing ones to ensure it stays working.
Diffstat (limited to 'lib/PublicInbox/SpawnPP.pm')
-rw-r--r-- | lib/PublicInbox/SpawnPP.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/SpawnPP.pm b/lib/PublicInbox/SpawnPP.pm index 7a5793f6..73859e9b 100644 --- a/lib/PublicInbox/SpawnPP.pm +++ b/lib/PublicInbox/SpawnPP.pm @@ -3,9 +3,11 @@ # Pure-Perl implementation of "spawn". This can't take advantage # of vfork, so no speedups under Linux for spawning from large processes. +# Do not require this directly, only use from PublicInbox::Spawn package PublicInbox::SpawnPP; use v5.12; use POSIX qw(dup2 _exit setpgid :signal_h); +use PublicInbox::Spawn qw(which); # Pure Perl implementation for folks that do not use Inline::C sub pi_fork_exec ($$$$$$$) { @@ -46,7 +48,8 @@ sub pi_fork_exec ($$$$$$$) { sigprocmask(SIG_SETMASK, $old) or die "SIG_SETMASK ~CHLD: $!"; $cmd->[0] = $f; if ($ENV{MOD_PERL}) { - @$cmd = (which('env'), '-i', @$env, @$cmd); + $f = which('env'); + @$cmd = ('env', '-i', @$env, @$cmd); } else { %ENV = map { split(/=/, $_, 2) } @$env; } |