ftp(1): Use closefrom() instead of individual close()s.

Use closefrom(3) instead of manually closing all file descriptors
between 3 and 19.

Obtained from:	OpenBSD (CVS 1.80)
This commit is contained in:
Pedro F. Giffuni 2018-01-29 01:05:57 +00:00
parent d6b6639713
commit d54cfbd18e

View File

@ -1438,8 +1438,7 @@ shell(int argc, char *argv[])
}
oldintr = xsignal(SIGINT, SIG_IGN);
if ((pid = fork()) == 0) {
for (pid = 3; pid < 20; pid++)
(void)close(pid);
(void)closefrom(3);
(void)xsignal(SIGINT, SIG_DFL);
shellp = getenv("SHELL");
if (shellp == NULL)