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";