kib 2010-08-28 17:42:08 UTC
FreeBSD src repository
SVN rev 211941 on 2010-08-28 17:42:08Z by kib
For some file types, select code registers two selfd structures. E.g.,
for socket, when specified POLLIN|POLLOUT in events, you would have one
selfd registered for receiving socket buffer, and one for sending. Now,
if both events are not ready to fire at the time of the initial scan,
but are simultaneously ready after the sleep, pollrescan() would iterate
over the pollfd struct twice. Since both times revents is not zero,
returned value would be off by one.
Fix this by recalculating the return value in pollout().
MFC after: 2 weeks
Revision Changes Path
1.182 +9 -3 src/sys/kern/sys_generic.c