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

Commit 398b551d authored by Tom Cherry's avatar Tom Cherry
Browse files

logd: notify kernel log readers of new messages

LogBuffer::log() returns either a negative number on error or a
positive number indicating the length of the message written.
Therefore, the check to notify kernel log readers of a new message
should be that this function's return value is > 0.

Bug: 78209416
Test: `adb logcat -b kernel` updates when new log messages are present
Merged-In: Icc18c0c22e62340994e5c26aedb72282d61c1541
Change-Id: Icc18c0c22e62340994e5c26aedb72282d61c1541
(cherry picked from commit cbfebdba)
parent 564e3581
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -825,7 +825,7 @@ int LogKlog::log(const char* buf, ssize_t len) {
                         (unsigned short)n);

    // notify readers
    if (!rc) {
    if (rc > 0) {
        reader->notifyNewLog(static_cast<log_mask_t>(1 << LOG_ID_KERNEL));
    }