-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paolo Bonzini on 8/21/2009 1:42 AM:
> This patch tests for the presence of O_CLOEXEC at run-time.
>
> The technique I use allows to use only two system calls instead of
> three on system where O_CLOEXEC does not work, at least after the
> first call to open_noinherit.
Sounds good to me, except for a couple of nits:
> +#ifdef O_CLOEXEC
> + /* 0 = unknown, 1 = yes, -1 = no. */
> + static bool have_cloexec;
This has to be an int, not a bool, per the documented semantics you gave it.
> + if (have_cloexec >= 0)
> + {
> + fd = open (name, flags | O_CLOEXEC);
^
Not sure how that 8-bit character got there.
- --
Don't work too hard, make some time for fun as well!
Eric Blake [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkqOi7IACgkQ84KuGfSFAYBgyACeM7KtVd4iWuXX5XMK0/+Mh1n+
VREAoJLoCuP0DL1ewOBB+TDH1agkYw9B
=VXK4
-----END PGP SIGNATURE-----