From 93c27e5acf4e9cfc8645b6c919e8e2be7b2fd381 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 7 Nov 2012 15:52:03 -0800 Subject: [PATCH] ocloexec --- Makefile.am | 1 + configure.ac | 4 +++- src/file_io.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index c7c1474..abdfb8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ ## Process this file with automake to produce Makefile.in +ACLOCAL_AMFLAGS = -I M4 DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror if BUILD_OCTAVE_MOD diff --git a/configure.ac b/configure.ac index 20ba55a..f0fccb0 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,9 @@ AC_SUBST(ACLOCAL_AMFLAGS, "-I M4") AC_LANG([C]) -AC_PROG_CC +AC_PROG_CC_STDC +AC_USE_SYSTEM_EXTENSIONS +AC_SYS_LARGEFILE AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_SED diff --git a/src/file_io.c b/src/file_io.c index 44f1b5a..a2ab738 100644 --- a/src/file_io.c +++ b/src/file_io.c @@ -564,6 +564,9 @@ psf_open_fd (PSF_FILE * pfile) return - SFE_BAD_OPEN_MODE ; break ; } ; +#ifdef O_CLOEXEC + oflag |= O_CLOEXEC; +#endif if (mode == 0) fd = open (pfile->path.c, oflag) ; -- 2.7.4