libxl: fix POLLHUP handling
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 31 Mar 2016 12:50:07 +0000 (14:50 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 6 Apr 2016 13:48:16 +0000 (14:48 +0100)
The current code in bootloader_copyfail will error out on expected POLLHUPs
because of a missing "else" in the if clause.

The behaviour that triggers this bug has only been seen on FreeBSD so far.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Suggested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_bootloader.c

index 0ae074a45a3ac601b81c460dea3c98e98b10b4e4..2cfc8cfaf28f716f231d938784cd53a9a33307d5 100644 (file)
@@ -591,8 +591,7 @@ static void bootloader_copyfail(libxl__egc *egc, const char *which,
         } else {
             LOG(ERROR, "unexpected POLLHUP on %s", which);
         }
-    }
-    if (!rc) {
+    } else if (!rc) {
         LOG(ERROR, "unexpected eof copying %s", which);
         rc = ERROR_FAIL;
     }