Silence some warnings introduced by #33507
[p5sagit/p5-mst-13.2.git] / ext / IO / t / io_sock.t
index b743bf0..24d6818 100755 (executable)
@@ -10,6 +10,11 @@ BEGIN {
 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';
@@ -17,15 +22,8 @@ BEGIN {
     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";