From 7ab3153f92f38223157c4c1f4af1c30e33c94a76 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Fri, 26 Apr 2024 19:06:46 +0200 Subject: Kernel/VFS: Change polling from variables to functions Instead of having to store state in variables functions are called to check the object directly. --- kernel/random.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel/random.c') diff --git a/kernel/random.c b/kernel/random.c index 38924ce..2d77ccd 100644 --- a/kernel/random.c +++ b/kernel/random.c @@ -155,8 +155,8 @@ int random_read(BYTEPTR buffer, u64 offset, u64 len, vfs_fd_t *fd) { } void add_random_devices(void) { - devfs_add_file("/random", random_read, random_write, NULL, 1, 1, - FS_TYPE_CHAR_DEVICE); - devfs_add_file("/urandom", random_read, random_write, NULL, 1, 1, - FS_TYPE_CHAR_DEVICE); + devfs_add_file("/random", random_read, random_write, NULL, always_has_data, + always_can_write, FS_TYPE_CHAR_DEVICE); + devfs_add_file("/urandom", random_read, random_write, NULL, always_has_data, + always_can_write, FS_TYPE_CHAR_DEVICE); } -- cgit v1.2.3