[Toybox] Moving ps name fields around.

Rob Landley rob at landley.net
Sun Jun 19 05:09:08 PDT 2016


On 06/15/2016 12:25 PM, enh wrote:
> On Tue, Jun 14, 2016 at 1:50 PM, Rob Landley <rob at landley.net> wrote:
>> On 06/13/2016 07:29 PM, enh wrote:
>>> AOSP is now using this, and ps lgtm.
>>
>> Yay!
> 
> the netstat cleanup doesn't seem to have broken anything obvious either :-)

You mean the first round of netstat cleanup didn't. :)

Although actually it did: DGRAM sockets used to have a blank state and
now they say LISTENING. (I'm diffing this netstat's output with the
host's, using -w to workaround the fact that the host left justifies
the inode field and this one right justifies. I left that alone because
right justifying numbers is probably better from a readability
standpoint.)

The other big difference (not introduced by me, it was there in the
version from last week) is that the "Foreign address" field truncates
differently:

-tcp        0      0 driftwood:47114         r-199-59-148-23.t:https ESTABLISHED
+tcp        0      0 driftwood:47114         r-199-59-148-23.twttr.c ESTABLISHED

I.E. the Ubuntu version carves enough space out the right edge of the
name to show the full protocol, and this appends the protocol to the
name and _then_ truncates it. (The append is in addr2str(), the truncate
is in display_routes(). The first hasn't got the length information
so it _can't_ produce the expected output string.)

I also confirmed that expanding the window width doesn't affect the
ubuntu version's behavior: it's hardwired column sizes adding up to
80 columns. (Actually 79. But it was worth a look...)

Rob



More information about the Toybox mailing list