Author: pfg Date: Mon Jan 29 01:05:57 2018 New Revision: 328525 URL: https://svnweb.freebsd.org/changeset/base/328525
Log: 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) Modified: head/contrib/tnftp/src/cmds.c Modified: head/contrib/tnftp/src/cmds.c ============================================================================== --- head/contrib/tnftp/src/cmds.c Mon Jan 29 00:22:30 2018 (r328524) +++ head/contrib/tnftp/src/cmds.c Mon Jan 29 01:05:57 2018 (r328525) @@ -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) _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"