mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
file: fix resizing
This commit is contained in:
@@ -269,9 +269,8 @@ int fd_dup(int oldfd, int newfd, bool exact, int fdflags, int *retfd) {
|
|||||||
int fd = getfree(newfd);
|
int fd = getfree(newfd);
|
||||||
|
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
size_t newsize = newfd < proc->fdcount ? proc->fdcount + 1 : newfd;
|
fd = newfd < proc->fdcount ? proc->fdcount : newfd;
|
||||||
fd = newsize - 1;
|
err = growtable(fd + 1);
|
||||||
err = growtable(newsize);
|
|
||||||
if (err)
|
if (err)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user