syscalls: random fixes

This commit is contained in:
Matheus
2024-04-20 10:26:00 -03:00
parent 4071613b17
commit 79a178642c
2 changed files with 8 additions and 3 deletions
+3 -3
View File
@@ -48,11 +48,11 @@ syscallret_t syscall_poll(context_t *, pollfd_t *fds, size_t nfds, int timeoutms
size_t eventcount = 0;
for (uintmax_t i = 0; i < nfds; ++i) {
fdsbuff[i].revents = 0;
// negative fds are ignored and return nothing
if (fdsbuff[i].fd < 0) {
fdsbuff[i].revents = 0;
if (fdsbuff[i].fd < 0)
continue;
}
file_t *file = fd_get(fdsbuff[i].fd);
if (file == NULL) {
+5
View File
@@ -10,6 +10,11 @@ syscallret_t syscall_utimensat(context_t *, int fd, char *upath, timespec_t uts[
.ret = -1
};
if (flags != 0) {
ret.errno = EINVAL;
return ret;
}
timespec_t ts[2];
if (uts == NULL)
ts[0] = ts[1] = timekeeper_time();