diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-07 06:31:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-15 17:28:02 -0400 |
commit | 4260c13ba9102d466f017139de990dfffaf4d997 (patch) | |
tree | 2ab48c5e1a2dcb242448e7b5883817ee68950de1 /net/nfc | |
parent | ff353d86a92ee709e18fa485423dbaa7a52af8f3 (diff) |
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>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/llcp/sock.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index 99196d3b84eb..3f339b19d140 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c | |||
@@ -340,11 +340,24 @@ static unsigned int llcp_sock_poll(struct file *file, struct socket *sock, | |||
340 | mask |= POLLERR; | 340 | mask |= POLLERR; |
341 | 341 | ||
342 | if (!skb_queue_empty(&sk->sk_receive_queue)) | 342 | if (!skb_queue_empty(&sk->sk_receive_queue)) |
343 | mask |= POLLIN; | 343 | mask |= POLLIN | POLLRDNORM; |
344 | 344 | ||
345 | if (sk->sk_state == LLCP_CLOSED) | 345 | if (sk->sk_state == LLCP_CLOSED) |
346 | mask |= POLLHUP; | 346 | mask |= POLLHUP; |
347 | 347 | ||
348 | if (sk->sk_shutdown & RCV_SHUTDOWN) | ||
349 | mask |= POLLRDHUP | POLLIN | POLLRDNORM; | ||
350 | |||
351 | if (sk->sk_shutdown == SHUTDOWN_MASK) | ||
352 | mask |= POLLHUP; | ||
353 | |||
354 | if (sock_writeable(sk)) | ||
355 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; | ||
356 | else | ||
357 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); | ||
358 | |||
359 | pr_debug("mask 0x%x\n", mask); | ||
360 | |||
348 | return mask; | 361 | return mask; |
349 | } | 362 | } |
350 | 363 | ||