1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-02 14:51:23 +00:00

Remove getdtablesize calls in favor of sysconf(_SC_OPEN_MAX). (#45)

`getdtablesize()` has long been deprecated in favor of
`sysconf(_SC_OPEN_MAX)`.
This commit is contained in:
Bruce Mitchener
2020-12-15 02:55:08 +07:00
committed by GitHub
parent 9c01d39812
commit 605499bfc2
2 changed files with 1 additions and 10 deletions

View File

@@ -446,13 +446,8 @@ int fork_Unix() {
dup2(sock, 1);
dup2(sock, 2);
#ifdef SYSVONLY
/* Make sure everything else is closed POSIX has no getdtab... */
/* Make sure everything else is closed. */
for (i = 3; i < sysconf(_SC_OPEN_MAX); i++) close(i);
#else
/* Make sure everything else is closed */
for (i = 3; i < getdtablesize(); i++) close(i);
#endif /* SYSVONLY */
/* Run the shell command and get the result */
status = system(cmdstring);