line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Protocol::DBus::Path; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
30
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
117
|
|
4
|
5
|
|
|
5
|
|
21
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
98
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
1663
|
use Protocol::DBus::Address (); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
96
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
26
|
use constant _DEFAULT_SYSTEM_MESSAGE_BUS => 'unix:path=/var/run/dbus/system_bus_socket'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
825
|
|
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
|
|
|
0
|
0
|
0
|
my $addr = $ENV{'DBUS_SESSION_BUS_ADDRESS'}; |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
0
|
|
|
0
|
if (!$addr && ($^O eq 'darwin')) { |
17
|
0
|
|
|
|
|
0
|
my $path = $ENV{'DBUS_LAUNCHD_SESSION_BUS_SOCKET'}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# OK, let’s *really* stretch … |
20
|
0
|
|
0
|
|
|
0
|
$path ||= readpipe( "launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET" ); |
21
|
0
|
|
|
|
|
0
|
chomp $path; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
0
|
if ($path) { |
24
|
0
|
|
|
|
|
0
|
chomp $path; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
$addr = "unix:path=$path"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
0
|
die "Found no login session message bus address!" if !$addr; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
return Protocol::DBus::Address::parse($addr); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub system_message_bus { |
36
|
1
|
|
50
|
1
|
0
|
14
|
return Protocol::DBus::Address::parse( $ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || _DEFAULT_SYSTEM_MESSAGE_BUS() ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |