fd: stop looking for exact freefile after allocation
If a lower fd is closed later, the lookup goes to waste. Allocation always performs the lookup anyway. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
1242588828
commit
663de8167e
@ -262,7 +262,7 @@ fdused(struct filedesc *fdp, int fd)
|
|||||||
if (fd > fdp->fd_lastfile)
|
if (fd > fdp->fd_lastfile)
|
||||||
fdp->fd_lastfile = fd;
|
fdp->fd_lastfile = fd;
|
||||||
if (fd == fdp->fd_freefile)
|
if (fd == fdp->fd_freefile)
|
||||||
fdp->fd_freefile = fd_first_free(fdp, fd, fdp->fd_nfiles);
|
fdp->fd_freefile++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user