summaryrefslogtreecommitdiffstats
path: root/logd/LogListener.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-04-28 16:39:04 -0700
committerMark Salyzyn <salyzyn@google.com>2014-04-29 07:25:27 -0700
commite0fa291e898b451dc198ed52cebac3ffefac066e (patch)
tree602b61b224b6630c12129def669ebc4aa6cfab3b /logd/LogListener.cpp
parent4095853133745ddaa1e37b46f9e7d4e8a2cdee28 (diff)
downloadsystem_core-e0fa291e898b451dc198ed52cebac3ffefac066e.zip
system_core-e0fa291e898b451dc198ed52cebac3ffefac066e.tar.gz
system_core-e0fa291e898b451dc198ed52cebac3ffefac066e.tar.bz2
logd: add logd.auditd property
- permit us a mechanism to disable auditd - standardize property boolean Bug: 14275676 Change-Id: I76f245c6aee511ed44274159e0ea55915b484dda
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r--logd/LogListener.cpp10
1 files changed, 5 insertions, 5 deletions
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 <limits.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/types.h>
@@ -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;
}