diff --git a/contrib/tnftp/src/cmds.c b/contrib/tnftp/src/cmds.c index 7be3a7782a17..a92d8c5672b6 100644 --- a/contrib/tnftp/src/cmds.c +++ b/contrib/tnftp/src/cmds.c @@ -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)