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

Re: [Xen-devel] [PATCH] libxl_qmp: Handle unexpected end-of-socket

On Mon, 2012-02-20 at 17:09 +0000, Ian Jackson wrote:
> Anthony PERARD writes ("[Xen-devel] [PATCH] libxl_qmp: Handle unexpected 
> end-of-socket"):
> > When read() return 0, the current code just tries again. But this leads to 
> > an
> > infinite loop if QEMU died too soon.
> Right.
> > Also, retry select if a signal was caught.
> Why add another goto ?  I think these goto-based loops are a bad idea,
> really.
> > +            if (errno == EINTR)
> > +                goto do_select_again;
> I think this could be "continue".  Do you agree.

Also select(2) says:
        On error, -1 is returned, and errno is set appropriately; the
               sets and timeout become undefined, so do not  rely  on  their  
               after an error.

So by my reading you need to reinitialise the sets anyway.


Xen-devel mailing list



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