commit | fade9a908cd8140e6eff5be473daa04672b87343 | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Tue May 19 22:01:05 2015 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue May 19 22:01:06 2015 +0000 |
tree | cb021e84a9a679620564b16da42c50ed01b9dc3f | |
parent | 96416182ab2597f33394ec019bfed6bb770c40e7 [diff] | |
parent | 8a98c4c38a1b6efd9cdd374928d40c420bd62877 [diff] |
Merge "klog: don't unconditionally call mknod()"
diff --git a/libcutils/klog.c b/libcutils/klog.c index f574f08..710dc66 100644 --- a/libcutils/klog.c +++ b/libcutils/klog.c
@@ -40,6 +40,11 @@ void klog_init(void) { if (klog_fd >= 0) return; /* Already initialized */ + klog_fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); + if (klog_fd >= 0) { + return; + } + static const char* name = "/dev/__kmsg__"; if (mknod(name, S_IFCHR | 0600, (1 << 8) | 11) == 0) { klog_fd = open(name, O_WRONLY | O_CLOEXEC);