[Toybox] Simplifying (was Re: top -H segfault)

Rob Landley rob at landley.net
Wed Jun 8 22:25:35 PDT 2016


On 06/08/2016 09:59 PM, enh wrote:
> On Wed, Jun 8, 2016 at 6:37 PM, Rob Landley <rob at landley.net> wrote:
>>> yeah, as far as i can tell this is right.
>>
>> Ok, I'll apply it then.
> 
> i can't actually tell any difference from this patch. remind me what changed?

Processes that weren't threads had a blank TNAME (because they
didn't have a snapshot of their parent process's argv[0] in
string slot 7).

This adds a fallback to show _this_ process's argv[0] when
the snapshot is blank. I.E.

    // If TNAME is blank, show ARGS instead
    if (which==PS_ARGS && !*out)
      out = tb->str+tb->offset[-2-typos[which = PS_ARGS].slot];

And then it falls back to showing stat[2] if they're both
blank (I.E. kernel threads).

How I explain that in the help text, I have no idea.

Rob


More information about the Toybox mailing list