aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_sched.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-25 21:59:24 -0400
committerIan Moffett <ian@osmora.org>2024-03-25 21:59:24 -0400
commitadd3e844cf9eaf49010fbee2aa73977086e47428 (patch)
tree358f06ac38e67ab9389e705803210227ddc0f4bc /sys/kern/kern_sched.c
parent51e23753f4e98ef278324e3ea13f9617fe3a7a80 (diff)
kernel: filedesc: Return status in fd_alloc()
It is better for fd_alloc() to return the status and have one of the arguments point to an output than have fd_alloc() return the allocated file descriptor just like that. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/kern_sched.c')
-rw-r--r--sys/kern/kern_sched.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index 776aaff..055b11a 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -271,9 +271,9 @@ sched_create_td(uintptr_t rip, char *argvp[], char *envp[], struct auxval auxv,
processor_init_pcb(td);
/* Allocate standard file descriptors */
- __assert(fd_alloc(td) != NULL); /* STDIN */
- __assert(fd_alloc(td) != NULL); /* STDOUT */
- __assert(fd_alloc(td) != NULL); /* STDERR */
+ __assert(fd_alloc(td, NULL) == 0); /* STDIN */
+ __assert(fd_alloc(td, NULL) == 0); /* STDOUT */
+ __assert(fd_alloc(td, NULL) == 0); /* STDERR */
/* Setup trapframe */
if (!is_user) {