| 1 | package Protocol::DBus::Path; | ||||||||||||||||||||||||||||
| 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 Protocol::DBus::Address (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use constant _DEFAULT_SYSTEM_MESSAGE_BUS => 'unix:path=/var/run/dbus/system_bus_socket'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # NB: If this returns “autolaunch:”, then the system should use | ||||||||||||||||||||||||||||
| 11 | # platform-specific methods of locating a running D-Bus session server, | ||||||||||||||||||||||||||||
| 12 | # or starting one if a running instance cannot be found. | ||||||||||||||||||||||||||||
| 13 | sub login_session_message_bus { | ||||||||||||||||||||||||||||
| 14 | 0 | ▶ | my $addr = $ENV{'DBUS_SESSION_BUS_ADDRESS'}; | ||||||||||||||||||||||||||
|
Subroutine
login_session_message_bus: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | if (!$addr && ($^O eq 'darwin')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $addr and $^O eq "darwin"
MC/DC0%0/2
not $addr and $^O eq "darwin"
not $addr
$^O eq "darwin"
Truth table0%0/3
not(A) and B
A= not $addrB= $^O eq "darwin"
| |||||||||||||||||||||||||||||
| 17 | 0 | my $path = $ENV{'DBUS_LAUNCHD_SESSION_BUS_SOCKET'}; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | # OK, let’s *really* stretch … | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | $path ||= readpipe( "launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET" ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$path ||= `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
MC/DC0%0/2
$path ||= `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
$path
`launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
Truth table0%0/3
A ||= B
A= $pathB= `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
| |||||||||||||||||||||||||||||
| 21 | 0 | chomp $path; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if ($path) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | chomp $path; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | $addr = "unix:path=$path"; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | die "Found no login session message bus address!" if !$addr; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | return Protocol::DBus::Address::parse($addr); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | sub system_message_bus { | ||||||||||||||||||||||||||||
| 36 | 1 | ▶ | return Protocol::DBus::Address::parse( $ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || _DEFAULT_SYSTEM_MESSAGE_BUS() ); | ||||||||||||||||||||||||||
|
Subroutine
system_message_bus: called CC=2 SCAR=7.6
Pod
undocumented
Condition50%1/2
$ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || 'unix:path=/var/run/dbus/system_bus_socket'
MC/DC0%0/1
$ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || 'unix:path=/var/run/dbus/system_bus_socket'
$ENV{'DBUS_SYSTEM_BUS_ADDRESS'}
Truth table50%1/2
A
A= $ENV{'DBUS_SYSTEM_BUS_ADDRESS'}
| |||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 5 | 1; | |||||||||||||||||||||||||||