From: WanBingjiang Date: Tue, 7 Jul 2026 02:45:29 +0000 (+0800) Subject: dmesg: treat EAGAIN from /dev/kmsg as EOF, not an error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=095cb2daa6809b20bb7a8d775d1916723cdb1706;p=thirdparty%2Futil-linux.git dmesg: treat EAGAIN from /dev/kmsg as EOF, not an error Fixes: https://github.com/util-linux/util-linux/issues/4468 --- diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index e39ec34a8..67d5e73dd 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1419,6 +1419,9 @@ static ssize_t read_kmsg_one(struct dmesg_control *ctl) sizeof(ctl->kmsg_buf) - 1); } while (size < 0 && errno == EPIPE); + if (size < 0 && errno == EAGAIN) + return 0; + return size; }