Remove vobjcnt field of Proc

This commit is contained in:
2025-10-14 20:07:42 +02:00
parent 406434fed0
commit 01b37e41c2
3 changed files with 8 additions and 11 deletions

View File

@ -38,18 +38,16 @@ int32_t SYSCALL2(sys_fs_openf, opath1, oflags1) {
Proc *proc = PROCS.current;
spinlock_release(&PROCS.spinlock);
if (proc->vobjcnt < PROC_VFSHANDLES_MAX) {
for (size_t i = 0; i < PROC_VFSHANDLES_MAX; i++) {
if (proc->vobjs[i] == NULL) {
proc->vobjs[i] = vobj;
ret = i;
break;
}
for (size_t i = 0; i < PROC_VFSHANDLES_MAX; i++) {
if (proc->vobjs[i] == NULL) {
proc->vobjs[i] = vobj;
ret = i;
goto done;
}
} else {
ret = E_NOMEMORY;
}
ret = E_NOMEMORY;
done:
return ret;
}