PING On Wed, Oct 30, 2013 at 1:39 AM, Janne Blomqvist <blomqvist.ja...@gmail.com> wrote: > Hello, > > the attached patch sets the close-on-exec flag when opening files, as > is usually considered good practice these days. See e.g. > http://www.python.org/dev/peps/pep-0446/ and links therein for more > information. > > The preconnected units INPUT_UNIT, OUTPUT_UNIT, ERROR_UNIT are not > affected, only new units created with the OPEN statement. In the > (very!?) unlikely event that someone really needs Fortran units to be > inherited to child processes, the close-on-exec flag can be cleared > with fcntl() before calling one of the exec() family functions. > > Regtested on x86_64-unknown-linux-gnu, Ok for trunk? > > 2013-10-30 Janne Blomqvist <j...@gcc.gnu.org> > > * configure.ac: Check presence of mkostemp. > * io/unix.c (set_close_on_exec): New function. > (tempfile_open): Use mkostemp and O_CLOEXEC if available, fallback > to calling set_close_on_exec. > (regular_file): Add O_CLOEXEC to flags if defined. > (open_external): Call set_close_on_exec if O_CLOEXEC is not > defined. > * config.h.in: Regenerated. > * configure: Regenerated. > > > -- > Janne Blomqvist
-- Janne Blomqvist