aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2014-03-21 16:41:12 +0100
committerHenrik Nord <[email protected]>2014-03-21 16:41:12 +0100
commitc2b4eab25c907f453a394d382c04cd04e6c06b49 (patch)
tree74715cd85b536c1beaf5d4d13690aa7bc329863d /erts/emulator/sys/unix
parent0aa69369016b20ea6a02ecf0ab9b2ce7e05325b0 (diff)
parenta2820c8db97c05d4fc11e04048c123e1da24da88 (diff)
downloadotp-c2b4eab25c907f453a394d382c04cd04e6c06b49.tar.gz
otp-c2b4eab25c907f453a394d382c04cd04e6c06b49.tar.bz2
otp-c2b4eab25c907f453a394d382c04cd04e6c06b49.zip
Merge branch 'nox/reedr-closefrom'
* nox/reedr-closefrom: Use closefrom(2) when available in child_setup Conflicts: erts/emulator/sys/unix/erl_child_setup.c OTP-11809
Diffstat (limited to 'erts/emulator/sys/unix')
-rw-r--r--erts/emulator/sys/unix/erl_child_setup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c
index 34d7f9e0e5..94eb6b1547 100644
--- a/erts/emulator/sys/unix/erl_child_setup.c
+++ b/erts/emulator/sys/unix/erl_child_setup.c
@@ -111,6 +111,13 @@ main(int argc, char *argv[])
(void) close(i);
#endif /* __ANDROID__ */
+#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)
return 1;