[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 13/13] libxl: replace for loop with more idiomatic do-while loop



Signed-off-by: Matthew Daley <mattd@xxxxxxxxxxx>
---
 tools/libxl/libxl.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4cd54a8..293e14a 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5413,14 +5413,11 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t 
poolid)
         goto out1;
     }
 
-    for (;;) {
+    do {
         t = xs_transaction_start(ctx->xsh);
 
         xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/pool/%d", 
poolid));
-
-        if (xs_transaction_end(ctx->xsh, t, 0) || (errno != EAGAIN))
-            break;
-    }
+    } while (!xs_transaction_end(ctx->xsh, t, 0) && errno == EAGAIN);
 
     rc = 0;
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.