Fork/Exit.pm

filter: Statementstmt 78.2% 18 / 23 Branchbran 40.0% 4 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 8 / 12 Podpod 87.5% 7 / 8 totaltotal 69.8% 37 / 53 CC 5 SCAR 12.6
CC
5
Cov
67%
coredump
12.0
signaled
2.1
pid
2.0
CRAP 3.5
« Fork/Child.pm ↑ Summary Fork/Request.pm »
1 package Linux::Event::Fork::Exit;
2 40 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 40 our $VERSION = '0.007';
7  
8 40 ▶use POSIX qw(WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # WCOREDUMP is not available/exported on all Perls/platforms.
11 # Detect it at compile time and gracefully return 0 when unavailable.
12 40 ▶my $HAS_WCOREDUMP = defined &POSIX::WCOREDUMP ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined &POSIX::WCOREDUMP ? : 0 40 40
13  
14 ▶sub new ($class, $pid, $status) {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
15 43 return bless { pid => $pid, status => $status }, $class;
16 }
17  
18 0 ▶sub pid ($self) { return $self->{pid} }
Subroutine pid: not called CC=1 SCAR=6.9
Pod documented
19 0 ▶sub status ($self) { return $self->{status} }
Subroutine status: not called CC=1 SCAR=6.9
Pod documented
20  
21 13 ▶sub exited ($self) { return WIFEXITED($self->{status}) ? 1 : 0 }
Subroutine exited: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
WIFEXITED($self->{'status'}) ? : 12 1 13
22 13 ▶sub code ($self) { return WEXITSTATUS($self->{status}) }
Subroutine code: called CC=1 SCAR=0.0
Pod documented
23  
24 1 ▶sub signaled ($self) { return WIFSIGNALED($self->{status}) ? 1 : 0 }
Subroutine signaled: called CC=2 SCAR=7.6
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
WIFSIGNALED($self->{'status'}) ? : 0 1 1
25 0 ▶sub signal ($self) { return WTERMSIG($self->{status}) }
Subroutine signal: not called CC=1 SCAR=6.9
Pod documented
26  
27 ▶sub coredump ($self) {
Subroutine coredump: not called CC=3 SCAR=24.8
Pod documented
28 0 ▶ return 0 if !$HAS_WCOREDUMP;
Branch: 1 branch
BranchTrueFalseTotal
unless $HAS_WCOREDUMP 0 0 0
29 0 ▶ return POSIX::WCOREDUMP($self->{status}) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
POSIX::WCOREDUMP($self->{'status'}) ? : 0 0 0
30 }
31  
32 40 1;
33  
34 __END__
« Fork/Child.pm ↑ Summary Fork/Request.pm »