DBus/Socket.pm

filter: Statementstmt 76.9% 20 / 26 Branchbran 0.0% 0 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 2 totaltotal 64.2% 27 / 42 SCAR 15.4
CC
4
Cov
66%
sendmsg_nosignal
12.0
BEGIN
2.0
BEGIN
1.0
CRAP 4.6
« DBus/Pack.pm ↑ Summary DBus.pm »
1 package Protocol::DBus::Socket;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶use Socket ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use IO::SigGuard ('send');
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # No support for this (POSIX-standard!) constant in macOS or Solaris.
11 5 ▶use constant _MSG_NOSIGNAL => eval { Socket::MSG_NOSIGNAL() } || 0;
Subroutine BEGIN: called CC=2 SCAR=7.0
Condition50%1/2
eval { do { 16384 } } || 0
l!l
50
MC/DC0%0/1
eval { do { 16384 } } || 0
eval { do { 16384 } }
Truth table50%1/2
A
A= eval { do { 16384 } }
Aresult
11
00
12  
13 sub send_nosignal {
14  
15 # This is for OSes that don’t define this constant:
16 3 ▶ local $SIG{'PIPE'} = 'IGNORE' if !_MSG_NOSIGNAL();
Subroutine send_nosignal: called CC=1 SCAR=0.0
Pod undocumented
17  
18 3 return IO::SigGuard::send( $_[0], $_[1], $_[2] | _MSG_NOSIGNAL() );
19 }
20  
21 5 my $sent;
22  
23 sub sendmsg_nosignal {
24  
25 # This is for OSes that don’t define this constant:
26 0 ▶ local $SIG{'PIPE'} = 'IGNORE' if !_MSG_NOSIGNAL();
Subroutine sendmsg_nosignal: not called CC=3 SCAR=24.8
Pod undocumented
27  
28 SEND: {
29 0 $sent = Socket::MsgHdr::sendmsg( $_[0], $_[1], $_[2] | _MSG_NOSIGNAL() );
30 0 ▶ if (!defined $sent) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $sent) 0 0 0
31 0 ▶ redo SEND if $!{'EINTR'};
Branch: 1 branch
BranchTrueFalseTotal
if $!{"EINTR"} 0 0 0
32 }
33 }
34  
35 0 return $sent;
36 }
37  
38 5 1;
« DBus/Pack.pm ↑ Summary DBus.pm »