]> Sergey Matveev's repositories - public-inbox.git/commitdiff
spawn_pp: fix incorrect `use'
authorEric Wong <e@80x24.org>
Thu, 9 Feb 2023 21:53:20 +0000 (21:53 +0000)
committerEric Wong <e@80x24.org>
Thu, 9 Feb 2023 22:09:40 +0000 (22:09 +0000)
We can't `use PublicInbox::Spawn' from SpawnPP because
PublicInbox::Spawn loads SpawnPP from BEGIN.

Fixes: 9eb8baf199cd148b (spawn_pp: use `which()' properly for pure-Perl spawn, 2023-01-29)
lib/PublicInbox/SpawnPP.pm

index 73859e9b11ecf9882bf7045db0e31005ba5fdb8c..5609f74a8781a49530fed377e031112ab4cdeead 100644 (file)
@@ -7,7 +7,7 @@
 package PublicInbox::SpawnPP;
 use v5.12;
 use POSIX qw(dup2 _exit setpgid :signal_h);
-use PublicInbox::Spawn qw(which);
+# this is loaded by PublicInbox::Spawn, so we can't use/require it, here
 
 # Pure Perl implementation for folks that do not use Inline::C
 sub pi_fork_exec ($$$$$$$) {
@@ -48,7 +48,7 @@ sub pi_fork_exec ($$$$$$$) {
                sigprocmask(SIG_SETMASK, $old) or die "SIG_SETMASK ~CHLD: $!";
                $cmd->[0] = $f;
                if ($ENV{MOD_PERL}) {
-                       $f = which('env');
+                       $f = PublicInbox::Spawn::which('env');
                        @$cmd = ('env', '-i', @$env, @$cmd);
                } else {
                        %ENV = map { split(/=/, $_, 2) } @$env;