diff options
author | Elliott Hughes <enh@google.com> | 2015-03-28 09:51:54 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-03-28 09:51:54 -0700 |
commit | c02f81cccb2626a45d61c3e9eb22a7e5ec261046 (patch) | |
tree | ae690c075d3fc96eab8476a1753a992015e74f6d /libcutils | |
parent | 5db3936dbe6fa73d45ab0f02b7166f43680084d3 (diff) | |
download | system_core-c02f81cccb2626a45d61c3e9eb22a7e5ec261046.zip system_core-c02f81cccb2626a45d61c3e9eb22a7e5ec261046.tar.gz system_core-c02f81cccb2626a45d61c3e9eb22a7e5ec261046.tar.bz2 |
Always unlink /dev/__kmsg__.
Whether the open succeeds or fails, we should unlink.
Change-Id: Ic2f1e10dc7b6d6e459c56049da00d165bd63ba8f
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/klog.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libcutils/klog.c b/libcutils/klog.c index fad2a8b..f574f08 100644 --- a/libcutils/klog.c +++ b/libcutils/klog.c @@ -40,12 +40,9 @@ void klog_set_level(int level) { void klog_init(void) { if (klog_fd >= 0) return; /* Already initialized */ - static const char *name = "/dev/__kmsg__"; + static const char* name = "/dev/__kmsg__"; if (mknod(name, S_IFCHR | 0600, (1 << 8) | 11) == 0) { klog_fd = open(name, O_WRONLY | O_CLOEXEC); - if (klog_fd == -1) { - return; - } unlink(name); } } |