summaryrefslogtreecommitdiff
path: root/src/kernel/fd.c
diff options
context:
space:
mode:
authordzwdz2021-08-24 16:34:18 +0200
committerdzwdz2021-08-24 16:34:18 +0200
commite6b76a8556e00c6f143679af8056c1b62e1c57a8 (patch)
tree16fff1c5976dd50ae4b0133ef9e8d1c29ea437a0 /src/kernel/fd.c
parent83fa1f34ea744da7d26997179a0dd6af751dd8b0 (diff)
fdop_dispatch: pass the fd struct instead of index
Diffstat (limited to 'src/kernel/fd.c')
-rw-r--r--src/kernel/fd.c5
1 files changed, 2 insertions, 3 deletions
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 <kernel/panic.h>
#include <kernel/proc.h>
-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: