Merge "logd: klogd crash (part deux)"
This commit is contained in:
commit
96c36d35ce
1 changed files with 7 additions and 1 deletions
|
|
@ -26,6 +26,7 @@
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
#include <log/logger.h>
|
#include <log/logger.h>
|
||||||
|
#include <private/android_filesystem_config.h>
|
||||||
|
|
||||||
#include "LogBuffer.h"
|
#include "LogBuffer.h"
|
||||||
#include "LogKlog.h"
|
#include "LogKlog.h"
|
||||||
|
|
@ -589,7 +590,12 @@ int LogKlog::log(const char *buf, size_t len) {
|
||||||
// Parse pid, tid and uid
|
// Parse pid, tid and uid
|
||||||
const pid_t pid = sniffPid(p, len - (p - buf));
|
const pid_t pid = sniffPid(p, len - (p - buf));
|
||||||
const pid_t tid = pid;
|
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.
|
// 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
|
// Some may view the following as an ugly heuristic, the desire is to
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue