Use closefrom() if available

This commit is contained in:
rfm 2023-11-14 11:34:55 +00:00
parent 15ff083a9a
commit ae9892db11
5 changed files with 27 additions and 0 deletions

View file

@ -1773,10 +1773,14 @@ GSPrivateCheckTasks()
/*
* Close any extra descriptors.
*/
#if defined(HAVE_CLOSEFROM)
closefrom(3);
#else
for (i = 3; i < NOFILE; i++)
{
(void) close(i);
}
#endif
if (0 != chdir(path))
{