[Toybox] [PATCH] telnetd: don't exit if waitpid() returns 0.

enh enh at google.com
Wed Mar 17 21:56:20 PDT 2021


Noticed while using telnetd to manually test some telnet fixes: telnetd
would sometimes exit when I'd disconnect because it couldn't find pid 0
on its list of sessions.

I've not seen obscure exits because select() times out, but I've also
changed that `return` to an error_exit() so we'll at least know what's
happened if that ever occurs.

Also use <arpa/telnet.h> rather than manually #define'ing its constants,
use the FLAG() macro throughout, and xsetsockopt(). Don't pointlessly
set errno to 0 at the start of main and then never look at it again.
---
 toys/pending/telnetd.c | 56 +++++++++++++++---------------------------
 1 file changed, 20 insertions(+), 36 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210317/795924b2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-telnetd-don-t-exit-if-waitpid-returns-0.patch
Type: text/x-patch
Size: 6859 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210317/795924b2/attachment-0002.bin>


More information about the Toybox mailing list