From e6b76a8556e00c6f143679af8056c1b62e1c57a8 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 24 Aug 2021 16:34:18 +0200 Subject: fdop_dispatch: pass the fd struct instead of index --- src/kernel/fd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/kernel/fd.c') diff --git a/src/kernel/fd.c b/src/kernel/fd.c index 54f1c72..7d448eb 100644 --- a/src/kernel/fd.c +++ b/src/kernel/fd.c @@ -2,9 +2,8 @@ #include #include -int fdop_dispatch(enum fdop fdop, fd_t fd, void *ptr, size_t len) { - if (fd < 0 || fd >= FD_MAX) return -1; - switch(process_current->fds[fd].type) { +int fdop_dispatch(enum fdop fdop, struct fd *fd, void *ptr, size_t len) { + switch(fd->type) { case FD_EMPTY: return -1; default: -- cgit v1.2.3