[PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / unix / af_unix.c
index 2b4cc2eea5b38bd6a686b94cb0136f8b7a18adbf..d901465ce0135093276d55adabbb7691591097c3 100644 (file)
@@ -1878,6 +1878,8 @@ static unsigned int unix_poll(struct file * file, struct socket *sock, poll_tabl
                mask |= POLLERR;
        if (sk->sk_shutdown == SHUTDOWN_MASK)
                mask |= POLLHUP;
+       if (sk->sk_shutdown & RCV_SHUTDOWN)
+               mask |= POLLRDHUP;
 
        /* readable? */
        if (!skb_queue_empty(&sk->sk_receive_queue) ||