about summary refs log tree commit homepage
path: root/lib/PublicInbox/SpawnPP.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/SpawnPP.pm')
-rw-r--r--lib/PublicInbox/SpawnPP.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/PublicInbox/SpawnPP.pm b/lib/PublicInbox/SpawnPP.pm
index dc2ef364..fe95d126 100644
--- a/lib/PublicInbox/SpawnPP.pm
+++ b/lib/PublicInbox/SpawnPP.pm
@@ -19,8 +19,15 @@ sub public_inbox_fork_exec ($$$$$$) {
                 if ($err != 2) {
                         dup2($err, 2) or die "dup2 failed for stderr: $!";
                 }
-                exec qw(env -i), @$env, @$cmd;
-                die "exec env -i ... $cmd->[0] failed: $!\n";
+
+                if ($ENV{MOD_PERL}) {
+                        exec qw(env -i), @$env, @$cmd;
+                        die "exec env -i ... $cmd->[0] failed: $!\n";
+                } else {
+                        local %ENV = map { split(/=/, $_, 2) } @$env;
+                        exec @$cmd;
+                        die "exec $cmd->[0] failed: $!\n";
+                }
         }
         $pid;
 }