Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98ecabce authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am fe5b2513: Merge "klog: don\'t unconditionally call mknod()"

* commit 'fe5b2513':
  klog: don't unconditionally call mknod()
parents b7d50950 fe5b2513
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -40,6 +40,11 @@ void klog_set_level(int level) {
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);