--- networking/telnetd.c +++ networking/telnetd.c @@ -100,8 +100,8 @@ //usage: IF_NOT_FEATURE_TELNETD_STANDALONE(" via inetd") "\n" //usage: "\n -l LOGIN Exec LOGIN on connect" //usage: "\n -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue" -//usage: "\n -K Close connection as soon as login exits" -//usage: "\n (normally wait until all programs close slave pty)" +//usage: "\n -K Do not close connection as soon as login exits," +//usage: "\n but wait until all programs close slave pty" //usage: IF_FEATURE_TELNETD_STANDALONE( //usage: "\n -p PORT Port to listen on" //usage: "\n -b ADDR[:PORT] Address to bind to" @@ -711,7 +711,7 @@ /* We don't want to die if just one session is broken */ signal(SIGPIPE, SIG_IGN); - if (opt & OPT_WATCHCHILD) + if (!(opt & OPT_WATCHCHILD)) signal(SIGCHLD, handle_sigchld); else /* prevent dead children from becoming zombies */ signal(SIGCHLD, SIG_IGN);