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:
parent
d6b6639713
commit
d54cfbd18e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user