Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use closefrom(2) when available in child_setup #285

Merged
merged 1 commit into from

4 participants

Anthony Ramine OTP Maintainer Henrik Nord Rick Reed
OTP Maintainer

Patch has passed first testings and has been assigned to be reviewed

Henrik Nord proxyles merged commit a2820c8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 9, 2014
  1. Rick Reed Anthony Ramine

    Use closefrom(2) when available in child_setup

    reedr authored nox committed
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +1 −1  erts/configure.in
  2. +4 −0 erts/emulator/sys/unix/erl_child_setup.c
2  erts/configure.in
View
@@ -1151,7 +1151,7 @@ fi
AC_SUBST(ERTS_BUILD_SMP_EMU)
-AC_CHECK_FUNCS([posix_fadvise])
+AC_CHECK_FUNCS([posix_fadvise closefrom])
AC_CHECK_HEADERS([linux/falloc.h])
dnl * Old glibcs have broken fallocate64(). Make sure not to use it.
AC_CACHE_CHECK([whether fallocate() works],i_cv_fallocate_works,[
4 erts/emulator/sys/unix/erl_child_setup.c
View
@@ -89,8 +89,12 @@ main(int argc, char *argv[])
if (sscanf(argv[CS_ARGV_FD_CR_IX], "%d:%d", &from, &to) != 2)
return 1;
+#if defined(HAVE_CLOSEFROM)
+ closefrom(from);
+#else
for (i = from; i <= to; i++)
(void) close(i);
+#endif
if (!(argv[CS_ARGV_WD_IX][0] == '.' && argv[CS_ARGV_WD_IX][1] == '\0')
&& chdir(argv[CS_ARGV_WD_IX]) < 0)
Something went wrong with that request. Please try again.