From patchwork Fri Jan 6 15:51:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [9/9] qemu-nbd: drop loop which can never loop Date: Fri, 06 Jan 2012 05:51:28 -0000 From: Stefan Hajnoczi X-Patchwork-Id: 134674 Message-Id: <1325865088-23897-10-git-send-email-stefanha@linux.vnet.ibm.com> To: Cc: Anthony Liguori , Stefan Hajnoczi For some reason nbd_client_thread() has a do..while loop which can never loop, the condition is bogus because we would take a goto instead. Drop the loop. Reported-by: Dr David Alan Gilbert Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- qemu-nbd.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 155b058..eb61c33 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -202,12 +202,10 @@ static void *nbd_client_thread(void *arg) int ret; pthread_t show_parts_thread; - do { - sock = unix_socket_outgoing(sockpath); - if (sock == -1) { - goto out; - } - } while (sock == -1); + sock = unix_socket_outgoing(sockpath); + if (sock == -1) { + goto out; + } ret = nbd_receive_negotiate(sock, NULL, &nbdflags, &size, &blocksize);