On Wed, Feb 15, 2023 at 01:17:33PM +0100, Stefano Brivio wrote:Nit: On Fri, 27 Jan 2023 16:11:09 +1100 David Gibson <david(a)gibson.dropbear.id.au> wrote:Huh... I never even knew the braces were optional for do while.This goto can be handled just as simply and more clearly with a do while. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- tcp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tcp.c b/tcp.c index f0085e3..f7228d1 100644 --- a/tcp.c +++ b/tcp.c @@ -2158,13 +2158,12 @@ static int tcp_data_from_sock(struct ctx *c, struct tcp_tap_conn *conn) iov_sock[fill_bufs].iov_len = iov_rem; /* Receive into buffers, don't dequeue until acknowledged by guest. */ -recvmsg: - len = recvmsg(s, &mh_sock, MSG_PEEK); - if (len < 0) { - if (errno == EINTR) - goto recvmsg; + do { + len = recvmsg(s, &mh_sock, MSG_PEEK); + } while (len < 0 && errno == EINTR);For consistency, we shouldn't use curly brackets if there's a single line in the loop body (only other occurrence: pasta_wait_for_ns()).I don't have a strong preference here and I can also fix it up on merge, by the way.-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson