file: fix resizing

This commit is contained in:
Matheus
2026-06-16 21:05:28 -03:00
parent 4cbc9ddfb9
commit 01e677d385
+2 -3
View File
@@ -269,9 +269,8 @@ int fd_dup(int oldfd, int newfd, bool exact, int fdflags, int *retfd) {
int fd = getfree(newfd);
if (fd == -1) {
size_t newsize = newfd < proc->fdcount ? proc->fdcount + 1 : newfd;
fd = newsize - 1;
err = growtable(newsize);
fd = newfd < proc->fdcount ? proc->fdcount : newfd;
err = growtable(fd + 1);
if (err)
goto cleanup;
}