xl: remove needless infinite-loop construct in create_domain
authorMatthew Daley <mattjd@gmail.com>
Wed, 30 Oct 2013 07:51:57 +0000 (20:51 +1300)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 31 Oct 2013 21:55:52 +0000 (21:55 +0000)
Use a simple if condition instead.

Coverity-ID: 1056150
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/xl_cmdimpl.c

index a935a18cb47106e44c730264ff6f36f7c6ccb726..d8f9abaa16daf7c7be3c390fcb83e315bf2d389c 100644 (file)
@@ -2144,9 +2144,8 @@ start:
 
         child1 = xl_fork(child_waitdaemon);
         if (child1) {
-            for (;;) {
-                got_child = xl_waitpid(child_waitdaemon, &status, 0);
-                if (got_child == child1) break;
+            got_child = xl_waitpid(child_waitdaemon, &status, 0);
+            if (got_child != child1) {
                 assert(got_child == -1);
                 perror("failed to wait for daemonizing child");
                 ret = ERROR_FAIL;