Jarkko pointed out that change #27710 was causing some
black smoke so makes the tests for fork() simpler, as
per lib\Test\Simple\t\fork.t for now. (Ideally we want
a $Config{d_pseudofork}, as suggested by Andy Dougherty,
but that'll have to wait until I get some more tuits.)
p4raw-link: @27710 on //depot/perl:
2f78ce11bc4a9355ade5d20a0825b10fbb177169
p4raw-id: //depot/perl@27718
use Config;
BEGIN {
+ my $can_fork = $Config{d_fork} ||
+ (($^O eq 'MSWin32' || $^O eq 'NetWare') and
+ $Config{useithreads} and
+ $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
+ );
my $reason;
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bSocket\b/) {
$reason = 'Socket extension unavailable';
elsif ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bIO\b/) {
$reason = 'IO extension unavailable';
}
- elsif (
- ! eval {
- my $pid= fork();
- ! defined($pid) and die "Fork failed!";
- ! $pid and exit;
- defined waitpid($pid, 0);
- }
- ) {
- $reason = "no fork: $@";
+ elsif (!$can_fork) {
+ $reason = 'no fork';
}
if ($reason) {
print "1..0 # Skip: $reason\n";
use Config;
BEGIN {
+ my $can_fork = $Config{d_fork} ||
+ (($^O eq 'MSWin32' || $^O eq 'NetWare') and
+ $Config{useithreads} and
+ $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
+ );
my $reason;
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bIO\b/) {
$reason = 'IO extension unavailable';
}
- elsif (
- ! eval {
- my $pid= fork();
- ! defined($pid) and die "Fork failed!";
- ! $pid and exit;
- defined waitpid($pid, 0);
- }
- ) {
- $reason = "no fork: $@";
+ elsif (!$can_fork) {
+ $reason = 'no fork';
}
elsif ($^O eq 'MSWin32' && !$ENV{TEST_IO_PIPE}) {
$reason = 'Win32 testing environment not set';
use Config;
BEGIN {
+ my $can_fork = $Config{d_fork} ||
+ (($^O eq 'MSWin32' || $^O eq 'NetWare') and
+ $Config{useithreads} and
+ $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
+ );
my $reason;
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bSocket\b/) {
$reason = 'Socket extension unavailable';
elsif ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bIO\b/) {
$reason = 'IO extension unavailable';
}
- elsif (
- ! eval {
- my $pid= fork();
- ! defined($pid) and die "Fork failed!";
- ! $pid and exit;
- defined waitpid($pid, 0);
- }
- ) {
- $reason = "no fork: $@";
+ elsif (!$can_fork) {
+ $reason = 'no fork';
}
if ($reason) {
print "1..0 # Skip: $reason\n";