diff mbox

libxl: fix POLLHUP handling

Message ID 1459428607-5028-1-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné March 31, 2016, 12:50 p.m. UTC
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>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_bootloader.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Wei Liu April 5, 2016, 3:12 p.m. UTC | #1
On Thu, Mar 31, 2016 at 02:50:07PM +0200, Roger Pau Monne wrote:
> 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>

> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
>  tools/libxl/libxl_bootloader.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
> index 0ae074a..2cfc8cf 100644
> --- a/tools/libxl/libxl_bootloader.c
> +++ b/tools/libxl/libxl_bootloader.c
> @@ -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;
>      }
> -- 
> 2.6.4 (Apple Git-63)
>
Ian Jackson April 6, 2016, 1:48 p.m. UTC | #2
Wei Liu writes ("Re: [PATCH] libxl: fix POLLHUP handling"):
> On Thu, Mar 31, 2016 at 02:50:07PM +0200, Roger Pau Monne wrote:
> > 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>

Queued, thanks.

Ian.
diff mbox

Patch

diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 0ae074a..2cfc8cf 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -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;
     }