diff options
author | Elliott Hughes <enh@google.com> | 2016-07-26 09:32:33 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2016-07-26 09:32:33 -0700 |
commit | 35f5d04620a3221b9f57194ab0239c7c7ba5a726 (patch) | |
tree | eaebe09b53c2aa953f33cb511ccffaf748412099 /libcutils | |
parent | 00a4ee0f46d36aff90fa120619f4dc6f4a837930 (diff) | |
download | system_core-35f5d04620a3221b9f57194ab0239c7c7ba5a726.tar.gz system_core-35f5d04620a3221b9f57194ab0239c7c7ba5a726.tar.bz2 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')
-rw-r--r-- | libcutils/klog.cpp | 10 |
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) { } static int __open_klog(void) { - int fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); - if (fd == -1) { - static const char* name = "/dev/__kmsg__"; - if (mknod(name, S_IFCHR | 0600, (1 << 8) | 11) == 0) { - fd = open(name, O_WRONLY | O_CLOEXEC); - unlink(name); - } - } - return fd; + return TEMP_FAILURE_RETRY(open("/dev/kmsg", O_WRONLY | O_CLOEXEC)); } #define LOG_BUF_MAX 512 |