]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/socket.c
[PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications
[linux-2.6-omap-h63xx.git] / net / sctp / socket.c
index fb1821d9f33809e5ace99b572cbbf813aea8d0ca..b6e4b89539b3178216037c53350f5591dde8a1b6 100644 (file)
@@ -4894,6 +4894,8 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
        /* Is there any exceptional events?  */
        if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
                mask |= POLLERR;
+       if (sk->sk_shutdown & RCV_SHUTDOWN)
+               mask |= POLLRDHUP;
        if (sk->sk_shutdown == SHUTDOWN_MASK)
                mask |= POLLHUP;
 
@@ -5426,7 +5428,7 @@ out:
        return err;
 
 do_error:
-       if (asoc->init_err_counter + 1 >= asoc->max_init_attempts)
+       if (asoc->init_err_counter + 1 > asoc->max_init_attempts)
                err = -ETIMEDOUT;
        else
                err = -ECONNREFUSED;