diff options
author | Henrik Nord <[email protected]> | 2014-03-21 16:41:12 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-03-21 16:41:12 +0100 |
commit | c2b4eab25c907f453a394d382c04cd04e6c06b49 (patch) | |
tree | 74715cd85b536c1beaf5d4d13690aa7bc329863d /erts/emulator/sys/unix | |
parent | 0aa69369016b20ea6a02ecf0ab9b2ce7e05325b0 (diff) | |
parent | a2820c8db97c05d4fc11e04048c123e1da24da88 (diff) | |
download | otp-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.c | 7 |
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; |