]> Git Repo - qemu.git/commitdiff
qemu-nbd: drop loop which can never loop
authorStefan Hajnoczi <[email protected]>
Thu, 5 Jan 2012 13:16:07 +0000 (13:16 +0000)
committerStefan Hajnoczi <[email protected]>
Fri, 6 Jan 2012 15:09:53 +0000 (15:09 +0000)
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 <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
qemu-nbd.c

index 155b05840bd22ba50c11dd255ca24d669e0e3e2b..eb61c33acd490f3aa786db4b9388aa2823d17447 100644 (file)
@@ -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);
This page took 0.027804 seconds and 4 git commands to generate.