Commit ce495618 authored by David S. Miller's avatar David S. Miller

[TCP]: Put Alexey's -EAGAIN change back in with Linus's fix on top.

parent a7fa6cb1
...@@ -1536,19 +1536,14 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1536,19 +1536,14 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
struct sk_buff *skb; struct sk_buff *skb;
u32 offset; u32 offset;
/* Are we at urgent data? Stop if we have read anything. */ /* Are we at urgent data? Stop if we have read anything or have SIGURG pending. */
if (copied && tp->urg_data && tp->urg_seq == *seq) if (tp->urg_data && tp->urg_seq == *seq) {
break;
/* We need to check signals first, to get correct SIGURG
* handling. FIXME: Need to check this doesn't impact 1003.1g
* and move it down to the bottom of the loop
*/
if (signal_pending(current)) {
if (copied) if (copied)
break; break;
copied = timeo ? sock_intr_errno(timeo) : -EAGAIN; if (signal_pending(current)) {
break; copied = timeo ? sock_intr_errno(timeo) : -EAGAIN;
break;
}
} }
/* Next get a buffer. */ /* Next get a buffer. */
...@@ -1587,6 +1582,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1587,6 +1582,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
sk->sk_state == TCP_CLOSE || sk->sk_state == TCP_CLOSE ||
(sk->sk_shutdown & RCV_SHUTDOWN) || (sk->sk_shutdown & RCV_SHUTDOWN) ||
!timeo || !timeo ||
signal_pending(current) ||
(flags & MSG_PEEK)) (flags & MSG_PEEK))
break; break;
} else { } else {
...@@ -1616,6 +1612,11 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1616,6 +1612,11 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
copied = -EAGAIN; copied = -EAGAIN;
break; break;
} }
if (signal_pending(current)) {
copied = sock_intr_errno(timeo);
break;
}
} }
cleanup_rbuf(sk, copied); cleanup_rbuf(sk, copied);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment