about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-09-24 03:39:03 +0000
committerEric Wong <e@80x24.org>2019-09-24 03:39:03 +0000
commit4b3e278d9c4e5d1f55c1781aa0a7c9f0453f3852 (patch)
tree484d489f7bd61d62cd8b394d3d91b81e9077d731
parent55283284757af5f5d8f63fd17d53340e4dea34fb (diff)
downloadpublic-inbox-4b3e278d9c4e5d1f55c1781aa0a7c9f0453f3852.tar.gz
We support "-env" to clear the environment with spawn(),
which causes test failures but no runtime failures
(since "-env" isn't used anywhere in our real code)

Reported-and-tested-by: Alyssa Ross <hi@alyssa.is>
-rw-r--r--lib/PublicInbox/SpawnPP.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/SpawnPP.pm b/lib/PublicInbox/SpawnPP.pm
index 25c8c87f..29b13371 100644
--- a/lib/PublicInbox/SpawnPP.pm
+++ b/lib/PublicInbox/SpawnPP.pm
@@ -38,11 +38,13 @@ sub pi_fork_exec ($$$$$$) {
                 }
 
                 if ($ENV{MOD_PERL}) {
-                        exec qw(env -i), @$env, @$cmd;
+                        exec which('env'), '-i', @$env, @$cmd;
                         die "exec env -i ... $cmd->[0] failed: $!\n";
                 } else {
                         local %ENV = map { split(/=/, $_, 2) } @$env;
-                        exec @$cmd;
+                        my @cmd = @$cmd;
+                        $cmd[0] = $f;
+                        exec @cmd;
                         die "exec $cmd->[0] failed: $!\n";
                 }
         }