]> Git Repo - linux.git/blobdiff - net/unix/af_unix.c
perf tools: Fix maps__find_symbol_by_name()
[linux.git] / net / unix / af_unix.c
index e5473c03d667ad51308c3e8b705f3b1187f619e8..d1edfa3cad61eaa63c2edbd4cbe70013aa298b18 100644 (file)
@@ -430,7 +430,12 @@ static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other)
 
        connected = unix_dgram_peer_wake_connect(sk, other);
 
-       if (unix_recvq_full(other))
+       /* If other is SOCK_DEAD, we want to make sure we signal
+        * POLLOUT, such that a subsequent write() can get a
+        * -ECONNREFUSED. Otherwise, if we haven't queued any skbs
+        * to other and its full, we will hang waiting for POLLOUT.
+        */
+       if (unix_recvq_full(other) && !sock_flag(other, SOCK_DEAD))
                return 1;
 
        if (connected)
@@ -2635,7 +2640,7 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa
        struct sock *sk = sock->sk;
        __poll_t mask;
 
-       sock_poll_wait(file, sk_sleep(sk), wait);
+       sock_poll_wait(file, wait);
        mask = 0;
 
        /* exceptional events? */
@@ -2672,7 +2677,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
        unsigned int writable;
        __poll_t mask;
 
-       sock_poll_wait(file, sk_sleep(sk), wait);
+       sock_poll_wait(file, wait);
        mask = 0;
 
        /* exceptional events? */
This page took 0.031192 seconds and 4 git commands to generate.