logd: add logd.auditd property
- permit us a mechanism to disable auditd
- standardize property boolean
Bug: 14275676
Change-Id: I76f245c6aee511ed44274159e0ea55915b484dda
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 @@
// 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;
}