summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2017-05-09 01:11:41 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-09 01:11:41 +0000
commitfa992c039dacaff3d8b0b84e84e877fbd5640581 (patch)
treea22abf9d7c0fb06669af7b764bbc9220f5618846 /logd
parentbd922038b69255caf92f5e18c9ed14dc60a94a83 (diff)
parentff04ade5e4135f6f3942ea3ab0ca3f47ffdc3122 (diff)
downloadcore-fa992c039dacaff3d8b0b84e84e877fbd5640581.tar.gz
core-fa992c039dacaff3d8b0b84e84e877fbd5640581.tar.bz2
core-fa992c039dacaff3d8b0b84e84e877fbd5640581.zip
Merge "logd: add "+passcred" for logdw socket" am: cc22a8e5a2 am: 518f054bfd
am: ff04ade5e4 Change-Id: I924893609e80661631c506a41459070823e40b74
Diffstat (limited to 'logd')
-rw-r--r--logd/LogListener.cpp10
-rw-r--r--logd/logd.rc2
2 files changed, 6 insertions, 6 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index 709646e37..3c0d08dc6 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -119,14 +119,14 @@ int LogListener::getLogSocket() {
static const char socketName[] = "logdw";
int sock = android_get_control_socket(socketName);
- if (sock < 0) {
+ if (sock < 0) { // logd started up in init.sh
sock = socket_local_server(
socketName, ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_DGRAM);
- }
- int on = 1;
- if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
- return -1;
+ int on = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on))) {
+ return -1;
+ }
}
return sock;
}
diff --git a/logd/logd.rc b/logd/logd.rc
index 7494d8fb3..88042466b 100644
--- a/logd/logd.rc
+++ b/logd/logd.rc
@@ -1,7 +1,7 @@
service logd /system/bin/logd
socket logd stream 0666 logd logd
socket logdr seqpacket 0666 logd logd
- socket logdw dgram 0222 logd logd
+ socket logdw dgram+passcred 0222 logd logd
file /proc/kmsg r
file /dev/kmsg w
user logd