mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 14:14:24 +08:00
NFC: Update the LLCP poll mask
Fix the poll mask depending on the socket state. POLLOUT was missing for example. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
ff353d86a9
commit
4260c13ba9
@ -340,11 +340,24 @@ static unsigned int llcp_sock_poll(struct file *file, struct socket *sock,
|
||||
mask |= POLLERR;
|
||||
|
||||
if (!skb_queue_empty(&sk->sk_receive_queue))
|
||||
mask |= POLLIN;
|
||||
mask |= POLLIN | POLLRDNORM;
|
||||
|
||||
if (sk->sk_state == LLCP_CLOSED)
|
||||
mask |= POLLHUP;
|
||||
|
||||
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
||||
mask |= POLLRDHUP | POLLIN | POLLRDNORM;
|
||||
|
||||
if (sk->sk_shutdown == SHUTDOWN_MASK)
|
||||
mask |= POLLHUP;
|
||||
|
||||
if (sock_writeable(sk))
|
||||
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
|
||||
else
|
||||
set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
|
||||
|
||||
pr_debug("mask 0x%x\n", mask);
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user