aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/unix/af_unix.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f33c5958dbb2..e8898758dd31 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2074,13 +2074,12 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
2074 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 2074 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
2075 mask |= POLLERR; 2075 mask |= POLLERR;
2076 if (sk->sk_shutdown & RCV_SHUTDOWN) 2076 if (sk->sk_shutdown & RCV_SHUTDOWN)
2077 mask |= POLLRDHUP; 2077 mask |= POLLRDHUP | POLLIN | POLLRDNORM;
2078 if (sk->sk_shutdown == SHUTDOWN_MASK) 2078 if (sk->sk_shutdown == SHUTDOWN_MASK)
2079 mask |= POLLHUP; 2079 mask |= POLLHUP;
2080 2080
2081 /* readable? */ 2081 /* readable? */
2082 if (!skb_queue_empty(&sk->sk_receive_queue) || 2082 if (!skb_queue_empty(&sk->sk_receive_queue))
2083 (sk->sk_shutdown & RCV_SHUTDOWN))
2084 mask |= POLLIN | POLLRDNORM; 2083 mask |= POLLIN | POLLRDNORM;
2085 2084
2086 /* Connection-based need to check for termination and startup */ 2085 /* Connection-based need to check for termination and startup */
@@ -2092,20 +2091,15 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
2092 return mask; 2091 return mask;
2093 } 2092 }
2094 2093
2095 /* writable? */
2096 writable = unix_writable(sk); 2094 writable = unix_writable(sk);
2097 if (writable) { 2095 other = unix_peer_get(sk);
2098 other = unix_peer_get(sk); 2096 if (other) {
2099 if (other) { 2097 if (unix_peer(other) != sk) {
2100 if (unix_peer(other) != sk) { 2098 sock_poll_wait(file, &unix_sk(other)->peer_wait, wait);
2101 sock_poll_wait(file, &unix_sk(other)->peer_wait, 2099 if (unix_recvq_full(other))
2102 wait); 2100 writable = 0;
2103 if (unix_recvq_full(other))
2104 writable = 0;
2105 }
2106
2107 sock_put(other);
2108 } 2101 }
2102 sock_put(other);
2109 } 2103 }
2110 2104
2111 if (writable) 2105 if (writable)