- $pid = fork;
- if ($pid == 0) { # pretend to be systemd
- fcntl($sock, F_SETFD, 0);
- dup2(fileno($sock), 3) or die "dup2 failed: $!\n";
- $ENV{LISTEN_PID} = $$;
- $ENV{LISTEN_FDS} = 1;
- $ENV{TEST_CHUNK} = '1';
- exec $httpd, "--stdout=$out", "--stderr=$err", $psgi;
- die "FAIL: $!\n";
- }
- ok(defined $pid, 'forked httpd process successfully');
+ my $cmd = [ $httpd, '-W0', "--stdout=$out", "--stderr=$err", $psgi ];
+ ok(defined($pid = spawn_listener(undef, $cmd, [$sock])),
+ 'forked httpd process successfully');