On Wed, Jan 24 2018, Theo Buehler <[email protected]> wrote:
> This variable reuse has a funny smell.
ok
> Index: usr.bin/ftp/cmds.c
> ===================================================================
> RCS file: /var/cvs/src/usr.bin/ftp/cmds.c,v
> retrieving revision 1.79
> diff -u -p -r1.79 cmds.c
> --- usr.bin/ftp/cmds.c 21 Jan 2017 08:33:07 -0000 1.79
> +++ usr.bin/ftp/cmds.c 23 Jan 2018 08:40:32 -0000
> @@ -987,8 +987,7 @@ shell(int argc, char *argv[])
> old1 = signal (SIGINT, SIG_IGN);
> old2 = signal (SIGQUIT, SIG_IGN);
> if ((pid = fork()) == 0) {
> - for (pid = 3; pid < 20; pid++)
> - (void)close(pid);
> + (void)closefrom(3);
> (void)signal(SIGINT, SIG_DFL);
> (void)signal(SIGQUIT, SIG_DFL);
> shellp = getenv("SHELL");
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE