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:
Mateusz Guzik 2018-12-11 11:57:12 +00:00
parent 1242588828
commit 663de8167e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341816

View File

@ -262,7 +262,7 @@ fdused(struct filedesc *fdp, int fd)
if (fd > fdp->fd_lastfile)
fdp->fd_lastfile = fd;
if (fd == fdp->fd_freefile)
fdp->fd_freefile = fd_first_free(fdp, fd, fdp->fd_nfiles);
fdp->fd_freefile++;
}
/*