diff options
author | Mark Salyzyn | 2016-08-12 09:38:18 -0500 |
---|---|---|
committer | android-build-merger | 2016-08-12 09:38:18 -0500 |
commit | f9fb584b664ab60c1d2ce7162dac262f8fd14ff3 (patch) | |
tree | 403c3b000ae4469bc71695115543ccb4f232bb35 /logd/LogKlog.cpp | |
parent | a8ce875cfbd7d195370103ca2962c3084c6d900d (diff) | |
parent | 6d2e1c73a34b156bf229ffbdba26cae66b6b42c9 (diff) | |
download | platform-system-core-f9fb584b664ab60c1d2ce7162dac262f8fd14ff3.tar.gz platform-system-core-f9fb584b664ab60c1d2ce7162dac262f8fd14ff3.tar.xz platform-system-core-f9fb584b664ab60c1d2ce7162dac262f8fd14ff3.zip |
Merge "logd: klogd crash (part deux)" am: 96c36d35ce am: e36dbdda43
am: 6d2e1c73a3
Change-Id: Ib31392aa400b744e144788792199931760568281
Diffstat (limited to 'logd/LogKlog.cpp')
-rw-r--r-- | logd/LogKlog.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/logd/LogKlog.cpp b/logd/LogKlog.cpp index da0aecc39..c7506efb8 100644 --- a/logd/LogKlog.cpp +++ b/logd/LogKlog.cpp | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <syslog.h> | 26 | #include <syslog.h> |
27 | 27 | ||
28 | #include <log/logger.h> | 28 | #include <log/logger.h> |
29 | #include <private/android_filesystem_config.h> | ||
29 | 30 | ||
30 | #include "LogBuffer.h" | 31 | #include "LogBuffer.h" |
31 | #include "LogKlog.h" | 32 | #include "LogKlog.h" |
@@ -614,7 +615,12 @@ int LogKlog::log(const char *buf, size_t len) { | |||
614 | // Parse pid, tid and uid | 615 | // Parse pid, tid and uid |
615 | const pid_t pid = sniffPid(&p, len - (p - buf)); | 616 | const pid_t pid = sniffPid(&p, len - (p - buf)); |
616 | const pid_t tid = pid; | 617 | const pid_t tid = pid; |
617 | const uid_t uid = pid ? logbuf->pidToUid(pid) : 0; | 618 | uid_t uid = AID_ROOT; |
619 | if (pid) { | ||
620 | logbuf->lock(); | ||
621 | uid = logbuf->pidToUid(pid); | ||
622 | logbuf->unlock(); | ||
623 | } | ||
618 | 624 | ||
619 | // Parse (rules at top) to pull out a tag from the incoming kernel message. | 625 | // Parse (rules at top) to pull out a tag from the incoming kernel message. |
620 | // Some may view the following as an ugly heuristic, the desire is to | 626 | // Some may view the following as an ugly heuristic, the desire is to |