summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/ext/Socket/t/socketpair.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/ext/Socket/t/socketpair.t')
-rw-r--r--gnu/usr.bin/perl/ext/Socket/t/socketpair.t17
1 files changed, 10 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/ext/Socket/t/socketpair.t b/gnu/usr.bin/perl/ext/Socket/t/socketpair.t
index 997628c3bd7..95d424a5c55 100644
--- a/gnu/usr.bin/perl/ext/Socket/t/socketpair.t
+++ b/gnu/usr.bin/perl/ext/Socket/t/socketpair.t
@@ -5,23 +5,26 @@ my $can_fork;
my $has_perlio;
BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
require Config; import Config;
- $can_fork = $Config{'d_fork'} || $Config{'d_pseudofork'};
+ $can_fork = $Config{'d_fork'}
+ || ($^O eq 'MSWin32' && $Config{useithreads}
+ && $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS\b/);
+
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;