]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: treat EAGAIN from /dev/kmsg as EOF, not an error
authorWanBingjiang <wanbingjiang@webray.com.cn>
Tue, 7 Jul 2026 02:45:29 +0000 (10:45 +0800)
committerWanBingjiang <wanbingjiang@webray.com.cn>
Tue, 7 Jul 2026 02:45:29 +0000 (10:45 +0800)
Fixes: https://github.com/util-linux/util-linux/issues/4468
sys-utils/dmesg.c

index e39ec34a8512bc8a66da5c1b7e82f1d4177533a4..67d5e73ddc55bcc2656dfac88f3b6b86a2a4a0c2 100644 (file)
@@ -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;
 }