summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Ralston2017-02-06 13:44:21 -0600
committerEvan Ralston2017-02-07 12:46:02 -0600
commit2c2337a293dfcd7a144996048e48c2a54b44c5f8 (patch)
tree03db437156eeff43c51b3e925796ab73738c3827 /liblog/logd_reader.c
parent9cd890e9b7a1ae1d354815f529a0b3df1dd07aea (diff)
downloadplatform-system-core-2c2337a293dfcd7a144996048e48c2a54b44c5f8.tar.gz
platform-system-core-2c2337a293dfcd7a144996048e48c2a54b44c5f8.tar.xz
platform-system-core-2c2337a293dfcd7a144996048e48c2a54b44c5f8.zip
Check against LOG_ID_MAX instead of LOG_ID_KERNEL
Logd currently checks against LOG_ID_KERNEL to determine if a given log_id is available. While this matches with the comments in log.h to always keep LOG_ID_KERNEL at the end it does not match with other checks that Logd makes causing inconsistent behavior. This inconsistency is noticable on devices with log buffers with id's greater than LOG_ID_KERNEL and liblog reports that logd is unavailable while logd would accept the request. Test: compiles. no functional change Change-Id: I0302d9e3f2657706fdf778f1e78e5604abf566e2
Diffstat (limited to 'liblog/logd_reader.c')
-rw-r--r--liblog/logd_reader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/liblog/logd_reader.c b/liblog/logd_reader.c
index 99d7fea3b..e09872cfa 100644
--- a/liblog/logd_reader.c
+++ b/liblog/logd_reader.c
@@ -90,7 +90,7 @@ LIBLOG_HIDDEN struct android_log_transport_read logdLoggerRead = {
90 90
91static int logdAvailable(log_id_t logId) 91static int logdAvailable(log_id_t logId)
92{ 92{
93 if (logId > LOG_ID_KERNEL) { 93 if (logId >= LOG_ID_MAX || logId == LOG_ID_KERNEL) {
94 return -EINVAL; 94 return -EINVAL;
95 } 95 }
96 if (logId == LOG_ID_SECURITY) { 96 if (logId == LOG_ID_SECURITY) {