From: Vincent Pit Date: Tue, 24 Mar 2015 02:25:29 +0000 (-0300) Subject: Protect t/09-load-threads.t against old relocated perls X-Git-Tag: v0.27~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=e86e8208c52e0d6cb0e040132025db13d6ea78f8;p=perl%2Fmodules%2FScope-Upper.git Protect t/09-load-threads.t against old relocated perls --- diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 89cf8d3..10aef24 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -38,12 +38,14 @@ BEGIN { if (defined $thread_safe_var) { my $stat = run_perl "require POSIX; require $module; exit($thread_safe_var ? POSIX::EXIT_SUCCESS() : POSIX::EXIT_FAILURE())"; - require POSIX; - my $res = $stat >> 8; - if ($res == POSIX::EXIT_SUCCESS()) { - $is_threadsafe = 1; - } elsif ($res == POSIX::EXIT_FAILURE()) { - $is_threadsafe = !1; + if (defined $stat) { + require POSIX; + my $res = $stat >> 8; + if ($res == POSIX::EXIT_SUCCESS()) { + $is_threadsafe = 1; + } elsif ($res == POSIX::EXIT_FAILURE()) { + $is_threadsafe = !1; + } } if (not defined $is_threadsafe) { skip_all "Could not detect if $module is thread safe or not";