mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-12 00:51:08 +00:00
more options to close descriptors (for portability)
This commit is contained in:
parent
ae9892db11
commit
dc96e8ec47
1 changed files with 9 additions and 1 deletions
|
@ -1775,10 +1775,18 @@ GSPrivateCheckTasks()
|
||||||
*/
|
*/
|
||||||
#if defined(HAVE_CLOSEFROM)
|
#if defined(HAVE_CLOSEFROM)
|
||||||
closefrom(3);
|
closefrom(3);
|
||||||
|
#elif defined(F_CLOSEM)
|
||||||
|
(void)fcntl(3, F_CLOSEM, 0);
|
||||||
|
#elif defined(_SC_OPEN_MAX)
|
||||||
|
i = sysconf(_SC_OPEN_MAX);
|
||||||
|
while (i-- > 3)
|
||||||
|
{
|
||||||
|
(void)close(i);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
for (i = 3; i < NOFILE; i++)
|
for (i = 3; i < NOFILE; i++)
|
||||||
{
|
{
|
||||||
(void) close(i);
|
(void)close(i);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue