From b82e6c82aedb58309bdcdd041cabb5f82ec62234 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Nov 2019 10:14:13 +0000 Subject: spawn: remove support for clearing the env It's unnecessary code which I'm not sure we ever used. In retrospect, completely clearing the environment doesn't make sense for the processes we spawn. We don't need to clobber individual environment variables in our code, either (and if we did for tests, we can use 'local'). --- t/spawn.t | 10 ---------- 1 file changed, 10 deletions(-) (limited to 't') diff --git a/t/spawn.t b/t/spawn.t index ebebfb57..2e409157 100644 --- a/t/spawn.t +++ b/t/spawn.t @@ -38,16 +38,6 @@ use PublicInbox::Spawn qw(which spawn popen_rd); is($?, 0, 'sh exited successfully'); } -{ - my ($r, $w); - pipe $r, $w or die "pipe failed: $!"; - my $pid = spawn(['env'], {}, { -env => 1, 1 => fileno($w) }); - close $w or die "close pipe[1] failed: $!"; - ok(!defined(<$r>), 'read stdout of spawned from pipe'); - is(waitpid($pid, 0), $pid, 'waitpid succeeds on spawned process'); - is($?, 0, 'env(1) exited successfully'); -} - { my $fh = popen_rd([qw(echo hello)]); ok(fileno($fh) >= 0, 'tied fileno works'); -- cgit v1.2.3-24-ge0c7