diff options
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r-- | logd/LogListener.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp index fc9e30ff4..3b4ef8822 100644 --- a/logd/LogListener.cpp +++ b/logd/LogListener.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <cutils/sockets.h> | 24 | #include <cutils/sockets.h> |
25 | #include <log/logger.h> | 25 | #include <log/logger.h> |
26 | #include <private/android_filesystem_config.h> | ||
26 | #include <private/android_logger.h> | 27 | #include <private/android_logger.h> |
27 | 28 | ||
28 | #include "LogListener.h" | 29 | #include "LogListener.h" |
@@ -34,7 +35,11 @@ LogListener::LogListener(LogBuffer *buf, LogReader *reader) | |||
34 | { } | 35 | { } |
35 | 36 | ||
36 | bool LogListener::onDataAvailable(SocketClient *cli) { | 37 | bool LogListener::onDataAvailable(SocketClient *cli) { |
37 | prctl(PR_SET_NAME, "logd.writer"); | 38 | static bool name_set; |
39 | if (!name_set) { | ||
40 | prctl(PR_SET_NAME, "logd.writer"); | ||
41 | name_set = true; | ||
42 | } | ||
38 | 43 | ||
39 | char buffer[sizeof_log_id_t + sizeof(uint16_t) + sizeof(log_time) | 44 | char buffer[sizeof_log_id_t + sizeof(uint16_t) + sizeof(log_time) |
40 | + LOGGER_ENTRY_MAX_PAYLOAD]; | 45 | + LOGGER_ENTRY_MAX_PAYLOAD]; |
@@ -75,7 +80,7 @@ bool LogListener::onDataAvailable(SocketClient *cli) { | |||
75 | return false; | 80 | return false; |
76 | } | 81 | } |
77 | 82 | ||
78 | if (cred->uid == getuid()) { | 83 | if (cred->uid == AID_LOGD) { |
79 | // ignore log messages we send to ourself. | 84 | // ignore log messages we send to ourself. |
80 | // Such log messages are often generated by libraries we depend on | 85 | // Such log messages are often generated by libraries we depend on |
81 | // which use standard Android logging. | 86 | // which use standard Android logging. |