summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-03-24 12:26:47 -0500
committerMark Salyzyn2014-04-17 11:14:24 -0500
commitdfc47e86858ea67c72f1df2fdb97094b8e8248f2 (patch)
tree749adb2e006a75d4deb2fb769b0dd7b6bc8d2914 /logd/LogListener.cpp
parent26bb9970c463eb1209803d833799f128484864ac (diff)
downloadplatform-system-core-dfc47e86858ea67c72f1df2fdb97094b8e8248f2.tar.gz
platform-system-core-dfc47e86858ea67c72f1df2fdb97094b8e8248f2.tar.xz
platform-system-core-dfc47e86858ea67c72f1df2fdb97094b8e8248f2.zip
logd: libsysutils: logd startup outside init environment
Change-Id: I3426b6c3eebdd0c8258e966dcaaaa2825d7a23d1
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r--logd/LogListener.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index b835b4f07..ed5b39156 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -107,7 +107,15 @@ bool LogListener::onDataAvailable(SocketClient *cli) {
107} 107}
108 108
109int LogListener::getLogSocket() { 109int LogListener::getLogSocket() {
110 int sock = android_get_control_socket("logdw"); 110 static const char socketName[] = "logdw";
111 int sock = android_get_control_socket(socketName);
112
113 if (sock < 0) {
114 sock = socket_local_server(socketName,
115 ANDROID_SOCKET_NAMESPACE_RESERVED,
116 SOCK_DGRAM);
117 }
118
111 int on = 1; 119 int on = 1;
112 if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { 120 if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
113 return -1; 121 return -1;