[Toybox] [PATCH] fix ps.c build

enh enh at google.com
Sat Apr 18 21:15:27 PDT 2015


On Sat, Apr 18, 2015 at 8:21 PM, Rob Landley <rob at landley.net> wrote:
> On Sat, Apr 18, 2015 at 8:48 PM, Isaac Dunham <ibid.ag at gmail.com> wrote:
>> On Sat, Apr 18, 2015 at 01:43:00PM -0700, enh wrote:
>>> Fix ps.c build.
>>>
>>> external/toybox/toys/pending/ps.c:315:21: error: address of array
>>> 'field->title' will always evaluate to 'true'
>>> [-Werror,-Wpointer-bool-conversion]
>>>         if (!field->title) strcpy(field->title, typos[field->which]);
>>>             ~~~~~~~~^~~~~
>>>
>>> diff --git a/toys/pending/ps.c b/toys/pending/ps.c
>>> index cb0f32c..29111d5 100644
>>> --- a/toys/pending/ps.c
>>> +++ b/toys/pending/ps.c
>>> @@ -312,7 +312,7 @@ void ps_main(void)
>>>            if (j!=2) break;
>>>          }
>>>          if (i == ARRAY_LEN(typos)) error_exit("bad -o %.*s", end-type, type);
>>> -        if (!field->title) strcpy(field->title, typos[field->which]);
>>> +        if (!*field->title) strcpy(field->title, typos[field->which]);
>>>          dlist_add_nomalloc((void *)&TT.fields, (void *)field);
>>
>> I think you might want to hold off on updating ps; right now, it's
>> the "current cleanup project", which means that it's likely to break at
>> random, repeatedly.
>> If you do update before that finishes, check that it works.
>
> Yeah, sorry. It's about 75% done, but the last time I got any
> significant work on it was the plane ride over here. (My flight back
> is shortly after midnight tuesday morning, I might get it finished on
> the way over. Dunno.)
>
> I intend to finish and promote it this month, for what that's worth.
> (I've got another 2 weeks...)

yeah, for now i've taken ps out of the Android .config. we didn't have
a symbolic link to it anyway, and although it's making progress, it's
not currently very likely that anyone would want to "toybox ps".

here's the current list of things from pending that get built into the
AOSP toybox binary. ones marked with * get a symbolic link too.

    toys/pending/dd.c
    toys/pending/expr.c *
    toys/pending/hwclock.c *
    toys/pending/more.c *
    toys/pending/pgrep.c *
    toys/pending/netstat.c *
    toys/pending/route.c *
    toys/pending/tar.c *
    toys/pending/top.c
    toys/pending/tr.c *
    toys/pending/traceroute.c

those with links are either demonstrably better than what we had, or
things we just didn't have before. so although rob worries, it's not
like we're shipping all of pending and relying on it :-)

 1429416927.0


More information about the Toybox mailing list