Commit c20fdb91 by Janne Blomqvist

Set close-on-exec flag when opening files.

2013-11-10  Janne Blomqvist  <jb@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.
	* Makefile.in: Regenerated.
	* aclocal.m4: Regenerated.

From-SVN: r204654
parent 8d448338
2013-11-10 Janne Blomqvist <jb@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.
* Makefile.in: Regenerated.
* aclocal.m4: Regenerated.
2013-10-01 Tobias Burnus <burnus@net-b.de> 2013-10-01 Tobias Burnus <burnus@net-b.de>
PR fortran/55469 PR fortran/55469
......
# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Inc. # Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
...@@ -87,6 +87,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ ...@@ -87,6 +87,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(cafexeclibdir)" \ am__installdirs = "$(DESTDIR)$(cafexeclibdir)" \
"$(DESTDIR)$(myexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" \ "$(DESTDIR)$(myexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" \
"$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)"
...@@ -1276,7 +1282,7 @@ all: $(BUILT_SOURCES) config.h ...@@ -1276,7 +1282,7 @@ all: $(BUILT_SOURCES) config.h
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .F90 .c .f90 .lo .o .obj .SUFFIXES: .F90 .c .f90 .lo .o .obj
am--refresh: am--refresh: Makefile
@: @:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
...@@ -1312,10 +1318,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) ...@@ -1312,10 +1318,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
config.h: stamp-h1 config.h: stamp-h1
@if test ! -f $@; then \ @if test ! -f $@; then rm -f stamp-h1; else :; fi
rm -f stamp-h1; \ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
...@@ -1422,11 +1426,11 @@ clean-toolexeclibLTLIBRARIES: ...@@ -1422,11 +1426,11 @@ clean-toolexeclibLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \ echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \ rm -f "$${dir}/so_locations"; \
done done
libcaf_single.la: $(libcaf_single_la_OBJECTS) $(libcaf_single_la_DEPENDENCIES) libcaf_single.la: $(libcaf_single_la_OBJECTS) $(libcaf_single_la_DEPENDENCIES) $(EXTRA_libcaf_single_la_DEPENDENCIES)
$(libcaf_single_la_LINK) -rpath $(cafexeclibdir) $(libcaf_single_la_OBJECTS) $(libcaf_single_la_LIBADD) $(LIBS) $(libcaf_single_la_LINK) -rpath $(cafexeclibdir) $(libcaf_single_la_OBJECTS) $(libcaf_single_la_LIBADD) $(LIBS)
libgfortran.la: $(libgfortran_la_OBJECTS) $(libgfortran_la_DEPENDENCIES) libgfortran.la: $(libgfortran_la_OBJECTS) $(libgfortran_la_DEPENDENCIES) $(EXTRA_libgfortran_la_DEPENDENCIES)
$(libgfortran_la_LINK) -rpath $(toolexeclibdir) $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD) $(LIBS) $(libgfortran_la_LINK) -rpath $(toolexeclibdir) $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD) $(LIBS)
libgfortranbegin.la: $(libgfortranbegin_la_OBJECTS) $(libgfortranbegin_la_DEPENDENCIES) libgfortranbegin.la: $(libgfortranbegin_la_OBJECTS) $(libgfortranbegin_la_DEPENDENCIES) $(EXTRA_libgfortranbegin_la_DEPENDENCIES)
$(libgfortranbegin_la_LINK) -rpath $(myexeclibdir) $(libgfortranbegin_la_OBJECTS) $(libgfortranbegin_la_LIBADD) $(LIBS) $(libgfortranbegin_la_LINK) -rpath $(myexeclibdir) $(libgfortranbegin_la_OBJECTS) $(libgfortranbegin_la_LIBADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
...@@ -5686,9 +5690,7 @@ uninstall-toolexeclibDATA: ...@@ -5686,9 +5690,7 @@ uninstall-toolexeclibDATA:
@$(NORMAL_UNINSTALL) @$(NORMAL_UNINSTALL)
@list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \ @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \ dir='$(DESTDIR)$(toolexeclibdir)'; $(am__uninstall_files_from_dir)
echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
...@@ -5760,10 +5762,15 @@ install-am: all-am ...@@ -5760,10 +5762,15 @@ install-am: all-am
installcheck: installcheck-am installcheck: installcheck-am
install-strip: install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ if test -z '$(STRIP)'; then \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
`test -z '$(STRIP)' || \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic: mostlyclean-generic:
clean-generic: clean-generic:
......
# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # generated automatically by aclocal 1.11.3 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
# Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
...@@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. ...@@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely. If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])]) To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
# Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 1
# AM_AUTOMAKE_VERSION(VERSION) # AM_AUTOMAKE_VERSION(VERSION)
# ---------------------------- # ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been # Automake X.Y traces this macro to ensure aclocal.m4 has been
...@@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], ...@@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11' [am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro. dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11.1], [], m4_if([$1], [1.11.3], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
]) ])
...@@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) ...@@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11.1])dnl [AM_AUTOMAKE_VERSION([1.11.3])dnl
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*- # AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 1
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'. # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
...@@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( ...@@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]]) Usually this means the macro was only invoked conditionally.]])
fi])]) fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
# Free Software Foundation, Inc. # 2010, 2011 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 10 # serial 12
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4, # written in clear, in which case automake, when reading aclocal.m4,
...@@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], ...@@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
# instance it was reported that on HP-UX the gcc test will end up # instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output # making a dummy file named `D' -- because `-MD' means `put the output
# in D'. # in D'.
rm -rf conftest.dir
mkdir conftest.dir mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're # Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory. # using a relative directory.
...@@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], ...@@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
break break
fi fi
;; ;;
msvisualcpp | msvcmsys) msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has # This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and # not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted. # so weak that their functioning should not be impacted.
...@@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], ...@@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK],
if test "x$enable_dependency_tracking" != xno; then if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp" am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\' AMDEPBACKSLASH='\'
am__nodep='_no'
fi fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
]) ])
# Generate code to set up dependency tracking. -*- Autoconf -*- # Generate code to set up dependency tracking. -*- Autoconf -*-
...@@ -545,12 +555,15 @@ for _am_header in $config_headers :; do ...@@ -545,12 +555,15 @@ for _am_header in $config_headers :; do
done done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
# Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 1
# AM_PROG_INSTALL_SH # AM_PROG_INSTALL_SH
# ------------------ # ------------------
# Define $install_sh. # Define $install_sh.
...@@ -569,8 +582,8 @@ AC_SUBST(install_sh)]) ...@@ -569,8 +582,8 @@ AC_SUBST(install_sh)])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering # From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
# Free Software Foundation, Inc. # 2011 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], ...@@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE],
[disable], [m4_define([am_maintainer_other], [enable])], [disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable]) [m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode], AC_ARG_ENABLE([maintainer-mode],
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
...@@ -736,12 +749,15 @@ else ...@@ -736,12 +749,15 @@ else
fi fi
]) ])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
# Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 1
# AM_PROG_MKDIR_P # AM_PROG_MKDIR_P
# --------------- # ---------------
# Check for `mkdir -p'. # Check for `mkdir -p'.
...@@ -764,13 +780,14 @@ esac ...@@ -764,13 +780,14 @@ esac
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
# Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 4 # serial 5
# _AM_MANGLE_OPTION(NAME) # _AM_MANGLE_OPTION(NAME)
# ----------------------- # -----------------------
...@@ -778,13 +795,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], ...@@ -778,13 +795,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME) # _AM_SET_OPTION(NAME)
# ------------------------------ # --------------------
# Set option NAME. Presently that only means defining a flag for this option. # Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION], AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS) # _AM_SET_OPTIONS(OPTIONS)
# ---------------------------------- # ------------------------
# OPTIONS is a space-separated list of Automake options. # OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
...@@ -860,12 +877,14 @@ Check your system clock]) ...@@ -860,12 +877,14 @@ Check your system clock])
fi fi
AC_MSG_RESULT(yes)]) AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 1
# AM_PROG_INSTALL_STRIP # AM_PROG_INSTALL_STRIP
# --------------------- # ---------------------
# One issue with vendor `install' (even GNU) is that you can't # One issue with vendor `install' (even GNU) is that you can't
...@@ -888,13 +907,13 @@ fi ...@@ -888,13 +907,13 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 2 # serial 3
# _AM_SUBST_NOTMAKE(VARIABLE) # _AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------- # ---------------------------
...@@ -903,13 +922,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) ...@@ -903,13 +922,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
AC_DEFUN([_AM_SUBST_NOTMAKE]) AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE) # AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------- # --------------------------
# Public sister of _AM_SUBST_NOTMAKE. # Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*- # Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc. # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -931,10 +950,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) ...@@ -931,10 +950,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# a tarball read from stdin. # a tarball read from stdin.
# $(am__untar) < result.tar # $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR], AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. [# Always define AMTAR for backward compatibility. Yes, it's still used
AM_MISSING_PROG([AMTAR], [tar]) # in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
m4_if([$1], [v7], m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1], [ustar],, [pax],, [m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])]) [m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive]) AC_MSG_CHECKING([how to create a $1 tar archive])
......
...@@ -606,6 +606,9 @@ ...@@ -606,6 +606,9 @@
/* Define if you have __mingw_snprintf. */ /* Define if you have __mingw_snprintf. */
#undef HAVE_MINGW_SNPRINTF #undef HAVE_MINGW_SNPRINTF
/* Define to 1 if you have the `mkostemp' function. */
#undef HAVE_MKOSTEMP
/* Define to 1 if you have the `mkstemp' function. */ /* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP #undef HAVE_MKSTEMP
......
...@@ -654,6 +654,7 @@ CPP ...@@ -654,6 +654,7 @@ CPP
am__fastdepCC_FALSE am__fastdepCC_FALSE
am__fastdepCC_TRUE am__fastdepCC_TRUE
CCDEPMODE CCDEPMODE
am__nodep
AMDEPBACKSLASH AMDEPBACKSLASH
AMDEP_FALSE AMDEP_FALSE
AMDEP_TRUE AMDEP_TRUE
...@@ -2596,6 +2597,7 @@ as_fn_append ac_func_list " umask" ...@@ -2596,6 +2597,7 @@ as_fn_append ac_func_list " umask"
as_fn_append ac_func_list " getegid" as_fn_append ac_func_list " getegid"
as_fn_append ac_func_list " secure_getenv" as_fn_append ac_func_list " secure_getenv"
as_fn_append ac_func_list " __secure_getenv" as_fn_append ac_func_list " __secure_getenv"
as_fn_append ac_func_list " mkostemp"
as_fn_append ac_header_list " math.h" as_fn_append ac_header_list " math.h"
# Check that the precious variables saved in the cache have kept the same # Check that the precious variables saved in the cache have kept the same
# value. # value.
...@@ -3386,11 +3388,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} ...@@ -3386,11 +3388,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# We need awk for the "check" target. The system "awk" is bad on # We need awk for the "check" target. The system "awk" is bad on
# some platforms. # some platforms.
# Always define AMTAR for backward compatibility. # Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
...@@ -3523,6 +3525,7 @@ fi ...@@ -3523,6 +3525,7 @@ fi
if test "x$enable_dependency_tracking" != xno; then if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp" am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\' AMDEPBACKSLASH='\'
am__nodep='_no'
fi fi
if test "x$enable_dependency_tracking" != xno; then if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE= AMDEP_TRUE=
...@@ -4340,6 +4343,7 @@ else ...@@ -4340,6 +4343,7 @@ else
# instance it was reported that on HP-UX the gcc test will end up # instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output # making a dummy file named `D' -- because `-MD' means `put the output
# in D'. # in D'.
rm -rf conftest.dir
mkdir conftest.dir mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're # Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory. # using a relative directory.
...@@ -4399,7 +4403,7 @@ else ...@@ -4399,7 +4403,7 @@ else
break break
fi fi
;; ;;
msvisualcpp | msvcmsys) msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has # This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and # not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted. # so weak that their functioning should not be impacted.
...@@ -5515,6 +5519,7 @@ else ...@@ -5515,6 +5519,7 @@ else
# instance it was reported that on HP-UX the gcc test will end up # instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output # making a dummy file named `D' -- because `-MD' means `put the output
# in D'. # in D'.
rm -rf conftest.dir
mkdir conftest.dir mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're # Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory. # using a relative directory.
...@@ -5574,7 +5579,7 @@ else ...@@ -5574,7 +5579,7 @@ else
break break
fi fi
;; ;;
msvisualcpp | msvcmsys) msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has # This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and # not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted. # so weak that their functioning should not be impacted.
...@@ -12337,7 +12342,7 @@ else ...@@ -12337,7 +12342,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 12340 "configure" #line 12345 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -12443,7 +12448,7 @@ else ...@@ -12443,7 +12448,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 12446 "configure" #line 12451 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -16589,6 +16594,8 @@ done ...@@ -16589,6 +16594,8 @@ done
fi fi
# Check strerror_r, cannot be above as versions with two and three arguments exist # Check strerror_r, cannot be above as versions with two and three arguments exist
......
...@@ -280,7 +280,7 @@ else ...@@ -280,7 +280,7 @@ else
strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \ strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \ getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
readlink getgid getpid getppid getuid geteuid umask getegid \ readlink getgid getpid getppid getuid geteuid umask getegid \
secure_getenv __secure_getenv) secure_getenv __secure_getenv mkostemp)
fi fi
# Check strerror_r, cannot be above as versions with two and three arguments exist # Check strerror_r, cannot be above as versions with two and three arguments exist
......
...@@ -1070,6 +1070,20 @@ unpack_filename (char *cstring, const char *fstring, int len) ...@@ -1070,6 +1070,20 @@ unpack_filename (char *cstring, const char *fstring, int len)
} }
/* Set the close-on-exec flag for an existing fd, if the system
supports such. */
static void __attribute__ ((unused))
set_close_on_exec (int fd __attribute__ ((unused)))
{
/* Mingw does not define F_SETFD. */
#if defined(F_SETFD) && defined(FD_CLOEXEC)
if (fd >= 0)
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
}
/* Helper function for tempfile(). Tries to open a temporary file in /* Helper function for tempfile(). Tries to open a temporary file in
the directory specified by tempdir. If successful, the file name is the directory specified by tempdir. If successful, the file name is
stored in fname and the descriptor returned. Returns -1 on stored in fname and the descriptor returned. Returns -1 on
...@@ -1109,7 +1123,12 @@ tempfile_open (const char *tempdir, char **fname) ...@@ -1109,7 +1123,12 @@ tempfile_open (const char *tempdir, char **fname)
mode_mask = umask (S_IXUSR | S_IRWXG | S_IRWXO); mode_mask = umask (S_IXUSR | S_IRWXG | S_IRWXO);
#endif #endif
#if defined(HAVE_MKOSTEMP) && defined(O_CLOEXEC)
fd = mkostemp (template, O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC);
#else
fd = mkstemp (template); fd = mkstemp (template);
set_close_on_exec (fd);
#endif
#ifdef HAVE_UMASK #ifdef HAVE_UMASK
(void) umask (mode_mask); (void) umask (mode_mask);
...@@ -1119,6 +1138,13 @@ tempfile_open (const char *tempdir, char **fname) ...@@ -1119,6 +1138,13 @@ tempfile_open (const char *tempdir, char **fname)
fd = -1; fd = -1;
int count = 0; int count = 0;
size_t slashlen = strlen (slash); size_t slashlen = strlen (slash);
int flags = O_RDWR | O_CREAT | O_EXCL;
#if defined(HAVE_CRLF) && defined(O_BINARY)
flags |= O_BINARY;
#endif
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#endif
do do
{ {
snprintf (template, tempdirlen + 23, "%s%sgfortrantmpaaaXXXXXX", snprintf (template, tempdirlen + 23, "%s%sgfortrantmpaaaXXXXXX",
...@@ -1142,14 +1168,12 @@ tempfile_open (const char *tempdir, char **fname) ...@@ -1142,14 +1168,12 @@ tempfile_open (const char *tempdir, char **fname)
continue; continue;
} }
#if defined(HAVE_CRLF) && defined(O_BINARY) fd = open (template, flags, S_IRUSR | S_IWUSR);
fd = open (template, O_RDWR | O_CREAT | O_EXCL | O_BINARY,
S_IRUSR | S_IWUSR);
#else
fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
#endif
} }
while (fd == -1 && errno == EEXIST); while (fd == -1 && errno == EEXIST);
#ifndef O_CLOEXEC
set_close_on_exec (fd);
#endif
#endif /* HAVE_MKSTEMP */ #endif /* HAVE_MKSTEMP */
*fname = template; *fname = template;
...@@ -1323,6 +1347,10 @@ regular_file (st_parameter_open *opp, unit_flags *flags) ...@@ -1323,6 +1347,10 @@ regular_file (st_parameter_open *opp, unit_flags *flags)
crflag |= O_BINARY; crflag |= O_BINARY;
#endif #endif
#ifdef O_CLOEXEC
crflag |= O_CLOEXEC;
#endif
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
fd = open (path, rwflag | crflag, mode); fd = open (path, rwflag | crflag, mode);
if (flags->action != ACTION_UNSPECIFIED) if (flags->action != ACTION_UNSPECIFIED)
...@@ -1386,6 +1414,9 @@ open_external (st_parameter_open *opp, unit_flags *flags) ...@@ -1386,6 +1414,9 @@ open_external (st_parameter_open *opp, unit_flags *flags)
/* regular_file resets flags->action if it is ACTION_UNSPECIFIED and /* regular_file resets flags->action if it is ACTION_UNSPECIFIED and
* if it succeeds */ * if it succeeds */
fd = regular_file (opp, flags); fd = regular_file (opp, flags);
#ifndef O_CLOEXEC
set_close_on_exec (fd);
#endif
} }
if (fd < 0) if (fd < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment