When readahead data is available, poll needs to return POLLIN or POLLRDNORM, not POLLOUT

This commit is contained in:
Gregory Nutt 2013-05-23 07:16:46 -06:00
parent 16d04c7aa7
commit 9d280a58aa
3 changed files with 10 additions and 4 deletions

View File

@ -4774,4 +4774,6 @@
STM32L-Discovery's segment LCD (2013-5-22).
* fs/fs_poll.c: Poll setup/teardown logic should ignore invalid (i.e.,
negative) file descriptors. Max Holtzberg (2013-5-23).
* net/net_poll.c: When readahead data is availalbe, the network poll
logic should set POLLIN (or POLLRDNORM), not POLLOUT. Max Holtzberg
(2013-5-23)

View File

@ -59,12 +59,14 @@
* Priority data may be read without blocking.
* POLLPRI
* High priority data may be read without blocking.
*
* POLLOUT
* Normal data may be written without blocking.
* POLLWRNORM
* Equivalent to POLLOUT.
* POLLWRBAND
* Priority data may be written.
*
* POLLERR
* An error has occurred (revents only).
* POLLHUP

View File

@ -250,7 +250,9 @@ static inline int net_pollsetup(FAR struct socket *psock,
if (!sq_empty(&conn->readahead))
#endif
{
fds->revents |= (POLLOUT & fds->events);
/* Normal data may be read without blocking. */
fds->revents |= (POLLRDNORM & fds->events);
}
/* Check for a loss of connection events. We need to be careful here.