summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2016-07-26 11:32:33 -0500
committerElliott Hughes2016-07-26 11:32:33 -0500
commit35f5d04620a3221b9f57194ab0239c7c7ba5a726 (patch)
treeeaebe09b53c2aa953f33cb511ccffaf748412099 /libcutils/klog.cpp
parent00a4ee0f46d36aff90fa120619f4dc6f4a837930 (diff)
downloadplatform-system-core-35f5d04620a3221b9f57194ab0239c7c7ba5a726.tar.gz
platform-system-core-35f5d04620a3221b9f57194ab0239c7c7ba5a726.tar.xz
platform-system-core-35f5d04620a3221b9f57194ab0239c7c7ba5a726.zip
Fix early init logging.
Remove the /dev/__kmsg__ workarounds (which can then be removed from sepolicy), and fix confusion in the translation between android-base logging and kernel logging priorities (in particular, where 'notice' comes in the hierarchy). Bug: http://b/30317429 Change-Id: I6eaf9919904b6b55bc402c20bf1a4ae269014bc7 Test: adb shell dmesg | grep init
Diffstat (limited to 'libcutils/klog.cpp')
-rw-r--r--libcutils/klog.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/libcutils/klog.cpp b/libcutils/klog.cpp
index abf643f4f..061af1bf4 100644
--- a/libcutils/klog.cpp
+++ b/libcutils/klog.cpp
@@ -37,15 +37,7 @@ void klog_set_level(int level) {
37} 37}
38 38
39static int __open_klog(void) { 39static int __open_klog(void) {
40 int fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); 40 return TEMP_FAILURE_RETRY(open("/dev/kmsg", O_WRONLY | O_CLOEXEC));
41 if (fd == -1) {
42 static const char* name = "/dev/__kmsg__";
43 if (mknod(name, S_IFCHR | 0600, (1 << 8) | 11) == 0) {
44 fd = open(name, O_WRONLY | O_CLOEXEC);
45 unlink(name);
46 }
47 }
48 return fd;
49} 41}
50 42
51#define LOG_BUF_MAX 512 43#define LOG_BUF_MAX 512