Commit a3b0a5a9 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller

[TIPC]: Simplify code for returning partial success of stream send request.

Signed-off-by: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPer Liden <per.liden@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b087b28
...@@ -969,7 +969,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock, ...@@ -969,7 +969,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
restart: restart:
if (unlikely((skb_queue_len(&sock->sk->sk_receive_queue) == 0) && if (unlikely((skb_queue_len(&sock->sk->sk_receive_queue) == 0) &&
(flags & MSG_DONTWAIT))) { (flags & MSG_DONTWAIT))) {
res = (sz_copied == 0) ? -EWOULDBLOCK : 0; res = -EWOULDBLOCK;
goto exit; goto exit;
} }
...@@ -1060,7 +1060,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock, ...@@ -1060,7 +1060,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
exit: exit:
up(&tsock->sem); up(&tsock->sem);
return res ? res : sz_copied; return sz_copied ? sz_copied : res;
} }
/** /**
......
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