poll: init changes

This commit is contained in:
Matheus
2023-09-30 12:48:55 -03:00
parent 355dd3f1f1
commit 9519e4c67a
4 changed files with 5 additions and 5 deletions
-1
View File
@@ -52,7 +52,6 @@ static mmuflags_t flagstommuflags(int flags) {
}
static int load(vnode_t *vnode, elfph64_t *ph) {
// TODO verify that the load address doesn't intersect the kernel
int error = 0;
uintmax_t foffset = ph->offset;
uintptr_t mempos = ph->memaddr;
+1 -2
View File
@@ -30,14 +30,13 @@ syscallret_t syscall_poll(context_t *, pollfd_t *fds, size_t nfds, int timeoutms
memcpy(fdsbuff, fds, fdsbuffsize);
polldesc_t desc = {0};
polldesc_t desc;
// when nfds is 0, poll is used as a sleep.
// therefore, initialize the desc size to one descriptor in that case.
ret.errno = poll_initdesc(&desc, nfds == 0 ? 1 : nfds);
if (ret.errno) {
goto cleanup;
}
__assert(spinlock_try(&desc.lock));
size_t eventcount = 0;