]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
For some file types, select code registers two selfd structures. E.g.,
authorKonstantin Belousov <kib@FreeBSD.org>
Sat, 28 Aug 2010 17:42:08 +0000 (17:42 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Sat, 28 Aug 2010 17:42:08 +0000 (17:42 +0000)
commit6d8fedda2ce56c34d484708c7ba4ce5019c5a620
tree8f4e23fc47f9fc937c132553fe1a1cc5eabde672
parent42992a3a9cd2ee5e99e15f5cfa6d217f773513b4
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().

PR: kern/143029
MFC after: 2 weeks
sys/kern/sys_generic.c