diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2014-06-22 01:31:55 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2014-06-22 01:31:55 +0000 |
commit | adf87ab01c2e33bc55526faa821e32eda43bbc2a (patch) | |
tree | da5e63a89bfc99a89e509c6cae0e1bd9a50d4de5 /sys/kern/sys_generic.c | |
parent | 0f0b852c73f5e9b70bc707b8738ca2e2ee3f78b0 (diff) | |
download | src-adf87ab01c2e33bc55526faa821e32eda43bbc2a.tar.gz src-adf87ab01c2e33bc55526faa821e32eda43bbc2a.zip |
fd: replace fd_nfiles with fd_lastfile where appropriate
fd_lastfile is guaranteed to be the biggest open fd, so when the intent
is to iterate over active fds or lookup one, there is no point in looking
beyond that limit.
Few places are left unpatched for now.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=267710
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 6cc4f13fe1a4..50bc91dea015 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1458,7 +1458,7 @@ pollscan(td, fds, nfd) FILEDESC_SLOCK(fdp); for (i = 0; i < nfd; i++, fds++) { - if (fds->fd >= fdp->fd_nfiles) { + if (fds->fd > fdp->fd_lastfile) { fds->revents = POLLNVAL; n++; } else if (fds->fd < 0) { |