|
@@ -1880,6 +1880,10 @@ static long unix_stream_data_wait(struct sock *sk, long timeo,
|
|
unix_state_unlock(sk);
|
|
unix_state_unlock(sk);
|
|
timeo = freezable_schedule_timeout(timeo);
|
|
timeo = freezable_schedule_timeout(timeo);
|
|
unix_state_lock(sk);
|
|
unix_state_lock(sk);
|
|
|
|
+
|
|
|
|
+ if (sock_flag(sk, SOCK_DEAD))
|
|
|
|
+ break;
|
|
|
|
+
|
|
clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
|
|
clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1939,6 +1943,10 @@ static int unix_stream_recvmsg(struct socket *sock, struct msghdr *msg,
|
|
struct sk_buff *skb, *last;
|
|
struct sk_buff *skb, *last;
|
|
|
|
|
|
unix_state_lock(sk);
|
|
unix_state_lock(sk);
|
|
|
|
+ if (sock_flag(sk, SOCK_DEAD)) {
|
|
|
|
+ err = -ECONNRESET;
|
|
|
|
+ goto unlock;
|
|
|
|
+ }
|
|
last = skb = skb_peek(&sk->sk_receive_queue);
|
|
last = skb = skb_peek(&sk->sk_receive_queue);
|
|
again:
|
|
again:
|
|
if (skb == NULL) {
|
|
if (skb == NULL) {
|