On 11/23/2010 03:24 AM, Daniel P. Berrange wrote:
> Should this function be changed to take a bool parameter for
marking
> logging fd's as cloexec? Or, for that matter, should all logging fd's
> always be cloexec in the first place?
Yes, everything libvirt does should be O_CLOEXEC really.
Agreed, but that means I need to revive some of my gnulib work to add
O_CLOEXEC to open(), as well as import pipe2() and other CLOEXEC-support
functions into libvirt, to make it faster on modern kernels. That can
be set aside for another day (post 0.8.6).
> In which case we wouldn't need this, because the fds would
then
> automatically avoid leaking?
I prefer to be paranoid about closing FDs even if we believe
they are all O_CLOEXEC already.
Fair enough. At any rate, your patch looks fine as is;
ACK.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org