| 1 | package Check::Fork; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 5 | ▶ | use base qw(Exporter); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 5 | ▶ | use Config; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 5 | ▶ | use Readonly; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 5 | our $ERROR_MESSAGE; | |||||||||||||||||||
| 11 | 5 | Readonly::Array our @EXPORT_OK => qw(check_fork $ERROR_MESSAGE); | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 5 | our $VERSION = 0.05; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 9 | ▶ | sub check_fork { | ||||||||||||||||||
|
Subroutine
check_fork: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||
| 16 | 9 | my ($config_hr, $os) = @_; | |||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 9 | ▶ | $config_hr ||= \%Config; | ||||||||||||||||||
|
Condition100%2/2
$config_hr ||= \%Check::Fork::Config
MC/DC100%1/1
$config_hr ||= \%Check::Fork::Config
$config_hr
Truth table100%2/2
A
A= $config_hr
| |||||||||||||||||||||
| 19 | 9 | ▶ | $os ||= $^O; | ||||||||||||||||||
|
Condition66%2/3
$os ||= $^O
MC/DC0%0/2
$os ||= $^O
$os
$^O
Truth table66%2/3
A ||= B
A= $osB= $^O
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 9 | ▶ | if ($config_hr->{'d_fork'}) { | ||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||
| 22 | 2 | return 1; | |||||||||||||||||||
| 23 | } elsif ($config_hr->{'d_pseudofork'}) { | ||||||||||||||||||||
| 24 | 1 | return 1; | |||||||||||||||||||
| 25 | ▶ | } elsif ($os eq 'MSWin32' || $os eq 'NetWare') { | |||||||||||||||||||
|
Condition100%3/3
$os eq "MSWin32" or $os eq "NetWare"
MC/DC100%2/2
$os eq "MSWin32" or $os eq "NetWare"
$os eq "MSWin32"
$os eq "NetWare"
Truth table100%3/3
A or B
A= $os eq "MSWin32"B= $os eq "NetWare"
| |||||||||||||||||||||
| 26 | 5 | ▶ | if (! $config_hr->{'useithreads'}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 27 | 2 | $ERROR_MESSAGE = "$os: No interpreter-based threading implementation."; | |||||||||||||||||||
| 28 | 2 | return 0; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | 3 | ▶ | if ($config_hr->{'ccflags'} !~ /-DPERL_IMPLICIT_SYS/) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | 1 | $ERROR_MESSAGE = "$os: No PERL_IMPLICIT_SYS ccflags set."; | |||||||||||||||||||
| 32 | 1 | return 0; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | 2 | return 1; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | 1 | $ERROR_MESSAGE = 'No fork() routine available.'; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 1 | return 0; | |||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 5 | 1; | |||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||