From 4048b75fd22d5e7506681cc81feeed8930d5915d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 26 Mar 2024 18:02:55 -0400 Subject: kernel: initramfs: Fix vop_read() vop_read() should return the actual count Signed-off-by: Ian Moffett --- sys/fs/initramfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/fs/initramfs.c b/sys/fs/initramfs.c index 6da0929..5b31bf9 100644 --- a/sys/fs/initramfs.c +++ b/sys/fs/initramfs.c @@ -137,12 +137,12 @@ vop_read(struct vnode *vp, char *buf, size_t count) for (size_t i = 0; i < count; ++i) { if (i >= size) { - break; + return i + 1; } buf[i] = contents[i]; } - return size; + return count; } static char * -- cgit v1.2.3