[libvirt] [PATCH] lxc_controller.c: don't ignore failed "accept"

Jim Meyering jim at meyering.net
Tue Feb 2 11:13:59 UTC 2010


Daniel P. Berrange wrote:

> On Tue, Feb 02, 2010 at 11:58:44AM +0100, Jim Meyering wrote:
>> coverity complained (rightly) about the risk of closing a negative
>> file descriptor.  However, the real problem was the missing test
>> for a failed "accept" call.  I'm not 100% sure that a failed
>> accept call deserves to provoke a "goto cleanup", but doing that
>> is consistent with what the nearby code does upon epoll_ctl failure.
>
> This isn't correct because the incoming client can quit between the
> time of poll() indicating its presence, and accept() trying to process
> it. This is an expected non-fatal scenario, so it should just be
> ignored without quitting. epoll_ctl() by comparison is a fatal system
> error, so has to be handled as an unrecoverable error

Ok, so some errno values are ignorable.
Do you also want to ignore the likes of EMFILE, ENFILE, EPERM, etc?

Otherwise, I propose to enumerate "ignorable-errno" values
and treat any others as unrecoverable.
Do you know which errno values should be ignored?




More information about the libvir-list mailing list