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

Commit 451a6ba8 authored by Todd Poynor's avatar Todd Poynor
Browse files

klog: error handling fixups

Change-Id: I9014e62010c589ec30d5e99eef420353e35418b5
parent ba4ac0cc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ void klog_init(void)

    if (mknod(name, S_IFCHR | 0600, (1 << 8) | 11) == 0) {
        klog_fd = open(name, O_WRONLY);
        if (klog_fd < 0)
                return;
        fcntl(klog_fd, F_SETFD, FD_CLOEXEC);
        unlink(name);
    }
@@ -54,6 +56,7 @@ void klog_write(int level, const char *fmt, ...)

    if (level > klog_level) return;
    if (klog_fd < 0) klog_init();
    if (klog_fd < 0) return;

    va_start(ap, fmt);
    vsnprintf(buf, LOG_BUF_MAX, fmt, ap);