<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 18, 2021 at 7:26 PM Rob Landley <<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/17/21 11:56 PM, enh via Toybox wrote:<br>
> 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>
You've been poking at unexpected bits of pending recently. My post-sh todo has<br>
the "pending" files from Android.bp as prioritized for cleanup, ala:<br>
<br>
    "toys/pending/dd.c",<br>
    "toys/pending/diff.c",<br>
    "toys/pending/expr.c",<br>
    "toys/pending/getfattr.c",<br>
    "toys/pending/getopt.c",<br>
    "toys/pending/lsof.c",<br>
    "toys/pending/modprobe.c",<br></blockquote><div><br></div><div>(modprobe isn't actually used on Android --- there's an Android modprobe that reuses the same code that init uses. i just keep building this in case anyone wants a second opinion :-) )</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    "toys/pending/more.c",<br>
    "toys/pending/readelf.c",<br></blockquote><div><br></div><div>(let me know before you get to this one so i can try to flush my nm.c to you first...)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    "toys/pending/stty.c",<br>
    "toys/pending/traceroute.c",<br></blockquote><div><br></div><div>(also not used on Android, but there for second opinions [and because we don't ship iputils on the device, that's just for local testing, but we do ship toybox].)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    "toys/pending/tr.c",<br>
    "toys/pending/vi.c",<br>
<br>
Neither init nor telnet are on there. (Not complaining, happy for the help, but<br>
is there something I should know about?)<br></blockquote><div><br></div><div>no, i just occasionally go scouting for random bugs from others.</div><div><br></div><div><a href="https://www.google.com/search?q=perfcrastination" target="_blank">https://www.google.com/search?q=perfcrastination</a><br></div><div><br></div><div>apparently there are people with devices they have to talk to using telnet, and the special case of CR handling in existing toybox telnet.c wasn't working for them. they hard-coded it the other way (which was all they needed), and i stepped in the time machine back to the 1990s and re-read the telnet RFCs. (because when you're as old and crufty as telnet, and were heavily used from the 1970s to the 1990s, you're spread across far too many RFCs!)</div><div><br></div><div>telnet.c was interesting because i fell into one of your traps (as you'll see now i've finally sent the patch) accidentally rewriting most of the file as i tried to understand it. even while writing the belated commit message just now i thought of another slight cleanup, but i hit send anyway and will worry about that later!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Rob<br>
</blockquote></div></div>