diff --git a/configure.ac b/configure.ac index 8f4bd0de..f4862f64 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,7 @@ dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS([uselocale]) AC_CHECK_FUNCS([eaccess]) +AC_CHECK_DECLS([closefrom]) dnl Enable largefile support AC_SYS_LARGEFILE diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c index b5a22023..713039b4 100644 --- a/src/ucm/ucm_exec.c +++ b/src/ucm/ucm_exec.c @@ -259,8 +259,8 @@ int uc_mgr_exec(const char *prog) close(f); -#if defined(_GNU_SOURCE) - close_range(3, maxfd, 0); +#if HAVE_DECL_CLOSEFROM + closefrom(3); #else for (f = 3; f < maxfd; f++) close(f);