[libvirt] [PATCHv2] build: use gnulib passfd for simpler SCM_RIGHTS code
Eric Blake
eblake at redhat.com
Tue Apr 26 16:38:46 UTC 2011
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 at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110426/c99c9de7/attachment-0001.sig>
More information about the libvir-list
mailing list