]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/httpd-corner.t: don't fail lsof test if stdin is a pipe (try #2)
authorEric Wong <e@80x24.org>
Tue, 17 Sep 2019 08:48:00 +0000 (08:48 +0000)
committerEric Wong <e@80x24.org>
Tue, 17 Sep 2019 08:48:00 +0000 (08:48 +0000)
Actually do the redirect properly

t/httpd-corner.t

index c6f78dde83d98430a2bae9ab2f44fbcc673f7cc8..4077a6d1a44bdb308dbacdaef2b5c7f7c2fcbef9 100644 (file)
@@ -32,8 +32,7 @@ my $psgi = "./t/httpd-corner.psgi";
 my $sock = tcp_server();
 
 # make sure stdin is not a pipe for lsof test to check for leaking pipes
-open(my $null, '<', '/dev/null') or die 'no /dev/null: $!';
-my $rdr = { 0 => fileno($null) };
+open(STDIN, '<', '/dev/null') or die 'no /dev/null: $!';
 
 # Make sure we don't clobber socket options set by systemd or similar
 # using socket activation:
@@ -61,7 +60,7 @@ END { kill 'TERM', $pid if defined $pid };
 my $spawn_httpd = sub {
        my (@args) = @_;
        my $cmd = [ $httpd, @args, "--stdout=$out", "--stderr=$err", $psgi ];
-       $pid = spawn_listener(undef, $cmd, [ $sock, $unix ], $rdr);
+       $pid = spawn_listener(undef, $cmd, [ $sock, $unix ]);
        ok(defined $pid, 'forked httpd process successfully');
 };