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

Re: [libvirt] [PATCHv2] build: use gnulib passfd for simpler SCM_RIGHTS code



On 04/26/2011 09:19 AM, Laine Stump wrote:
>>>>            do {
>>>> -            ret = recvmsg(pair[0],&msg, 0);
>>>> +            ret = recvfd(pair[0], 0);
>>>>            } while (ret<   0&&   errno == EINTR);
>> ret == -1 and errno == EACCES on failure to transfer fd...
>>

>>>          if (!WIFEXITED(status) || (ret = -WEXITSTATUS(status)) ==
>>> -EACCES ||
>>>              fd == -1) {
>>>              /* fall back to the simpler method, which works better in
>>>               * some cases */
>>>              return virFileOpenAsNoFork(path, openflags, mode, uid,
>>> gid, flags);
>>>          }
>> so this uses the fallback code, regardless of child exit status, and we
>> also ensured that the child got reaped.
>>
>>> What if errno == EACCES? Will we be getting all the error recovery we
>>> need in the caller?
>> Yes.

Another way to look at it - for all failures except EACCES, the child is
immediately reaped and the overall function failed; with EACCES, we
still want to try the non-forking fallback.

> 
> Okay. In that case, ACK.

Thanks for the review; pushed.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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