summaryrefslogtreecommitdiff
path: root/kernel/queue.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-04-26 19:06:46 +0200
committerAnton Kling <anton@kling.gg>2024-04-26 19:06:46 +0200
commit7ab3153f92f38223157c4c1f4af1c30e33c94a76 (patch)
tree301f950cd6dc8fde244e9b5c1201ec01d964347b /kernel/queue.c
parent2e2805c88789c148cce0118d3a4ff0212458bb86 (diff)
Kernel/VFS: Change polling from variables to functions
Instead of having to store state in variables functions are called to check the object directly.
Diffstat (limited to 'kernel/queue.c')
-rw-r--r--kernel/queue.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/queue.c b/kernel/queue.c
index b1cf698..0bef21b 100644
--- a/kernel/queue.c
+++ b/kernel/queue.c
@@ -57,8 +57,10 @@ int queue_should_block(struct event_queue *q, int *is_empty) {
kprintf("queue: Invalid fd given\n");
continue;
}
- if (fd->inode->has_data) {
- return 0;
+ if (fd->inode->_has_data) {
+ if (fd->inode->_has_data(fd->inode)) {
+ return 0;
+ }
}
} else if (EVENT_TYPE_TCP_SOCKET == ev->type) {
struct TcpConnection *con = tcp_get_connection(ev->internal_id, q->p);