| 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
| |||||||||||
| 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
| |||||||||||
| 26 | 1 | $NS->__THROW( 'FileOpen', path => $path, mode => $mode, mask => $perms ); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 1 | return $ret; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 1 | 1; | |||||||||