tcp: Remove 'recvmsg' goto from tcp_data_from_sock
This goto can be handled just as simply and more clearly with a do while. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
42bfd212b1
commit
83b2061ae7
1 changed files with 5 additions and 6 deletions
11
tcp.c
11
tcp.c
|
@ -2186,13 +2186,12 @@ static int tcp_data_from_sock(struct ctx *c, struct tcp_tap_conn *conn)
|
||||||
iov_sock[fill_bufs].iov_len = iov_rem;
|
iov_sock[fill_bufs].iov_len = iov_rem;
|
||||||
|
|
||||||
/* Receive into buffers, don't dequeue until acknowledged by guest. */
|
/* Receive into buffers, don't dequeue until acknowledged by guest. */
|
||||||
recvmsg:
|
do
|
||||||
len = recvmsg(s, &mh_sock, MSG_PEEK);
|
len = recvmsg(s, &mh_sock, MSG_PEEK);
|
||||||
if (len < 0) {
|
while (len < 0 && errno == EINTR);
|
||||||
if (errno == EINTR)
|
|
||||||
goto recvmsg;
|
if (len < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
goto zero_len;
|
goto zero_len;
|
||||||
|
|
Loading…
Reference in a new issue