mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
usrsock: Check RECVFROM_AVAIL before setting POLLIN in pollsetup
In usrsock_pollsetup, only set POLLIN if USRSOCK_EVENT_RECVFROM_AVAIL is set when remote is closed, avoiding invalid POLLIN events. Signed-off-by: daichuan <daichuan@xiaomi.com>
This commit is contained in:
parent
7a4a6ce4ce
commit
a82ee60da8
1 changed files with 7 additions and 1 deletions
|
|
@ -223,7 +223,13 @@ static int usrsock_pollsetup(FAR struct socket *psock,
|
|||
|
||||
/* Remote closed. */
|
||||
|
||||
eventset |= (POLLHUP | POLLIN);
|
||||
eventset |= POLLHUP;
|
||||
if (conn->flags & USRSOCK_EVENT_RECVFROM_AVAIL)
|
||||
{
|
||||
ninfo("socket recv avail.\n");
|
||||
|
||||
eventset |= POLLIN;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue