summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-21 22:17:56 -0400
committerIan Moffett <ian@osmora.org>2024-05-21 22:17:56 -0400
commit8fdacd25827ea30aa71ea14f9ac52ea3d01d3701 (patch)
tree9c72fb82f79800991cd7741b02d90908a2745083
parent9a4ec7539041f9ff25b947b2716aded028c0291f (diff)
kernel: filedesc: Fix fd_from_fdnum()
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/kern/kern_filedesc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/kern/kern_filedesc.c b/sys/kern/kern_filedesc.c
index ec0aee7..17a3d84 100644
--- a/sys/kern/kern_filedesc.c
+++ b/sys/kern/kern_filedesc.c
@@ -181,13 +181,7 @@ fd_from_fdnum(const struct proc *td, int fdno)
return NULL;
}
- for (size_t i = 0; i < PROC_MAX_FDS; ++i) {
- if (i == fdno && td->fds[i] != NULL) {
- return td->fds[i];
- }
- }
-
- return NULL;
+ return td->fds[fdno];
}
/*