line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Protocol::DBus::Socket; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
44
|
use strict; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
227
|
|
4
|
9
|
|
|
9
|
|
35
|
use warnings; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
192
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
2476
|
use Socket (); |
|
9
|
|
|
|
|
17087
|
|
|
9
|
|
|
|
|
278
|
|
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
3351
|
use IO::SigGuard ('send'); |
|
9
|
|
|
|
|
2823
|
|
|
9
|
|
|
|
|
54
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# No support for this (POSIX-standard!) constant in macOS or Solaris. |
11
|
9
|
|
50
|
9
|
|
3492
|
use constant _MSG_NOSIGNAL => eval { Socket::MSG_NOSIGNAL() } || 0; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
16
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub send_nosignal { |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# This is for OSes that don’t define this constant: |
16
|
3
|
|
|
3
|
0
|
4
|
local $SIG{'PIPE'} = 'IGNORE' if !_MSG_NOSIGNAL(); |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
18
|
return IO::SigGuard::send( $_[0], $_[1], $_[2] | _MSG_NOSIGNAL() ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $sent; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub sendmsg_nosignal { |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# This is for OSes that don’t define this constant: |
26
|
0
|
|
|
0
|
0
|
|
local $SIG{'PIPE'} = 'IGNORE' if !_MSG_NOSIGNAL(); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
SEND: { |
29
|
0
|
|
|
|
|
|
$sent = Socket::MsgHdr::sendmsg( $_[0], $_[1], $_[2] | _MSG_NOSIGNAL() ); |
|
0
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
if (!defined $sent) { |
31
|
0
|
0
|
|
|
|
|
redo SEND if $!{'EINTR'}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return $sent; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |