Die/sysopen.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 20 / 20 CC 3 SCAR 9.2
CC
3
Cov
100%
sysopen
3.0
BEGIN
1.0
CRAP 2.5
« Die/readlink.pm ↑ Summary Die/sysread.pm »
1 package IO::Die;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶sub sysopen {
Subroutine sysopen: called CC=3 SCAR=11.0
6 2 my ( $NS, @post_handle_args ) = ( shift, @_[ 1 .. $#_ ] );
7  
8 #https://github.com/pjcj/Devel--Cover/issues/125
9 #my ( $NS, $handle_r, @post_handle_args ) = ( shift, \shift, @_ );
10  
11 2 my ( $path, $mode, $perms ) = @post_handle_args;
12  
13 2 local ( $!, $^E );
14  
15 2 my $ret;
16 2 ▶ if ( @post_handle_args < 3 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@post_handle_args < 3) { } 1 1 2
17 1 $ret = CORE::sysopen( $_[0], $path, $mode );
18 }
19 else {
20 1 $ret = CORE::sysopen( $_[0], $path, $mode, $perms );
21 }
22  
23 #XXX: Perl bug? $! is often set here even when $ret is truthy.
24  
25 2 ▶ if ( !$ret ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($ret) 1 1 2
26 1 $NS->__THROW( 'FileOpen', path => $path, mode => $mode, mask => $perms );
27 }
28  
29 1 return $ret;
30 }
31  
32 1 1;
« Die/readlink.pm ↑ Summary Die/sysread.pm »