Skip to content

Commit

Permalink
[TIPC]: Simplify code for returning partial success of stream send re…
Browse files Browse the repository at this point in the history
…quest.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jun 26, 2006
1 parent 4b087b2 commit a3b0a5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
restart:
if (unlikely((skb_queue_len(&sock->sk->sk_receive_queue) == 0) &&
(flags & MSG_DONTWAIT))) {
res = (sz_copied == 0) ? -EWOULDBLOCK : 0;
res = -EWOULDBLOCK;
goto exit;
}

Expand Down Expand Up @@ -1060,7 +1060,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,

exit:
up(&tsock->sem);
return res ? res : sz_copied;
return sz_copied ? sz_copied : res;
}

/**
Expand Down

0 comments on commit a3b0a5a

Please sign in to comment.