summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-03-21 13:12:16 -0700
committerMark Salyzyn <salyzyn@google.com>2014-03-21 15:43:31 -0700
commit22e287df0dfbc6e10c02f570d2fc0c42a2a6b7aa (patch)
tree116a1e1e60ac9bea738373f730205a4613c91c41 /logd
parentee212d0053c6c8801dbd382d24c776040c4f8f0e (diff)
downloadsystem_core-22e287df0dfbc6e10c02f570d2fc0c42a2a6b7aa.zip
system_core-22e287df0dfbc6e10c02f570d2fc0c42a2a6b7aa.tar.gz
system_core-22e287df0dfbc6e10c02f570d2fc0c42a2a6b7aa.tar.bz2
logcat: white and blacklist failure
- logcat improperly squashes out count - logcat test enhanced to catch failure - logd places entries in ascending sorted order Change-Id: If39d8e2c40852b520c98e7840034ab63c2538e5d
Diffstat (limited to 'logd')
-rw-r--r--logd/LogListener.cpp4
-rw-r--r--logd/LogWhiteBlackList.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index bef2097..874302a 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -95,7 +95,9 @@ bool LogListener::onDataAvailable(SocketClient *cli) {
msg += sizeof(log_time);
n -= sizeof(log_time);
- unsigned short len = n;
+ // NB: hdr.msg_flags & MSG_TRUNC is not tested, silently passing a
+ // truncated message to the logs.
+ unsigned short len = n; // cap to internal maximum
if (len == n) {
logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, len);
reader->notifyNewLog();
diff --git a/logd/LogWhiteBlackList.cpp b/logd/LogWhiteBlackList.cpp
index d0ceb9f..5f8173f 100644
--- a/logd/LogWhiteBlackList.cpp
+++ b/logd/LogWhiteBlackList.cpp
@@ -154,8 +154,8 @@ int PruneList::init(char *str) {
}
m = pid - p->mPid;
}
- if (m >= 0) {
- if (m > 0) {
+ if (m <= 0) {
+ if (m < 0) {
list->insert(it, new Prune(uid,pid));
}
break;