[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] popen-safer: test O_CLOEXEC at run-time.
From: |
Eric Blake |
Subject: |
Re: [PATCH] popen-safer: test O_CLOEXEC at run-time. |
Date: |
Fri, 21 Aug 2009 05:57:38 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666 |
-----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 address@hidden
-----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-----
- Re: popen bugs, popen_safer, (continued)
- Re: popen bugs, popen_safer, Eric Blake, 2009/08/19
- O_CLOEXEC support (was: popen bugs, popen_safer), Eric Blake, 2009/08/19
- Re: O_CLOEXEC support, Eric Blake, 2009/08/20
- Re: O_CLOEXEC support, Paolo Bonzini, 2009/08/21
- Re: O_CLOEXEC support, Paolo Bonzini, 2009/08/21
- Re: O_CLOEXEC support, Eric Blake, 2009/08/21
- [PATCH] popen-safer: test O_CLOEXEC at run-time., Paolo Bonzini, 2009/08/21
- Re: [PATCH] popen-safer: test O_CLOEXEC at run-time.,
Eric Blake <=
- Re: [PATCH] popen-safer: test O_CLOEXEC at run-time., Paolo Bonzini, 2009/08/21
- Re: O_CLOEXEC support, James Youngman, 2009/08/30
- fcntl module (was: O_CLOEXEC support), Eric Blake, 2009/08/21
- Re: fcntl module, Paolo Bonzini, 2009/08/22
- Re: fcntl module (was: O_CLOEXEC support), Bruno Haible, 2009/08/22
- Re: fcntl module, Paolo Bonzini, 2009/08/22
- Re: fcntl module, Bruno Haible, 2009/08/22
- Re: fcntl module, Paolo Bonzini, 2009/08/23
- Re: fcntl module, Eric Blake, 2009/08/22
- Re: fcntl module, Bruno Haible, 2009/08/22