From e0fa291e898b451dc198ed52cebac3ffefac066e Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 28 Apr 2014 16:39:04 -0700 Subject: logd: add logd.auditd property - permit us a mechanism to disable auditd - standardize property boolean Bug: 14275676 Change-Id: I76f245c6aee511ed44274159e0ea55915b484dda --- logd/LogListener.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'logd/LogListener.cpp') diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp index bc7622b..6ff4d3a 100644 --- a/logd/LogListener.cpp +++ b/logd/LogListener.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -100,11 +101,10 @@ bool LogListener::onDataAvailable(SocketClient *cli) { // 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(); - } + + logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, + (n <= USHRT_MAX) ? (unsigned short) n : USHRT_MAX); + reader->notifyNewLog(); return true; } -- cgit v1.1