Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8353be2 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "logd: klogd crash (part deux)" am: 96c36d35 am: e36dbdda am:...

Merge "Merge "logd: klogd crash (part deux)" am: 96c36d35 am: e36dbdda am: 6d2e1c73 am: f9fb584b"
parents 407a2195 a0f32859
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <syslog.h>

#include <log/logger.h>
#include <private/android_filesystem_config.h>

#include "LogBuffer.h"
#include "LogKlog.h"
@@ -614,7 +615,12 @@ int LogKlog::log(const char *buf, size_t len) {
    // Parse pid, tid and uid
    const pid_t pid = sniffPid(&p, len - (p - buf));
    const pid_t tid = pid;
    const uid_t uid = pid ? logbuf->pidToUid(pid) : 0;
    uid_t uid = AID_ROOT;
    if (pid) {
        logbuf->lock();
        uid = logbuf->pidToUid(pid);
        logbuf->unlock();
    }

    // Parse (rules at top) to pull out a tag from the incoming kernel message.
    // Some may view the following as an ugly heuristic, the desire is to