[PATCH] *-Compress-* 2.020
[p5sagit/p5-mst-13.2.git] / ext / Socket / t / socketpair.t
index 95d424a..03cb5a4 100644 (file)
@@ -8,23 +8,22 @@ BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
     require Config; import Config;
-    $can_fork = $Config{'d_fork'}
-               || ($^O eq 'MSWin32' && $Config{useithreads}
-                   && $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS\b/);
-
+    $can_fork = $Config{'d_fork'} || $Config{'d_pseudofork'};
 
     if ($^O eq "hpux" or $Config{'extensions'} !~ /\bSocket\b/ &&
         !(($^O eq 'VMS') && $Config{d_socket})) {
        print "1..0\n";
        exit 0;
-      }
+    }
+}
+
+{
+    # This was in the BEGIN block, but since Test::More 0.47 added support to
+    # detect forking, we don't need to fork before Test::More initialises.
 
     # Too many things in this test will hang forever if something is wrong,
     # so we need a self destruct timer. And IO can hang despite an alarm.
 
-    # This is convoluted, but we must fork before Test::More, else child's
-    # Test::More thinks that it ran no tests, and prints a message to that
-    # effect
     if( $can_fork) {
       my $parent = $$;
       $child = fork;