<div dir="ltr">Noticed while using telnetd to manually test some telnet fixes: telnetd<br>would sometimes exit when I'd disconnect because it couldn't find pid 0<br>on its list of sessions.<br><br>I've not seen obscure exits because select() times out, but I've also<br>changed that `return` to an error_exit() so we'll at least know what's<br>happened if that ever occurs.<br><br>Also use <arpa/telnet.h> rather than manually #define'ing its constants,<br>use the FLAG() macro throughout, and xsetsockopt(). Don't pointlessly<br>set errno to 0 at the start of main and then never look at it again.<br>---<br> toys/pending/telnetd.c | 56 +++++++++++++++---------------------------<br> 1 file changed, 20 insertions(+), 36 deletions(-)<br></div>