[PATCH] Added to ps ruser,group,rgroup,nice options for -o

David Krakov krakov at gmail.com
Sun Jul 5 19:46:20 UTC 2009


> I plan to apply attached modified patch. Can you test it?

Works for me.

> @@ -311,7 +338,7 @@ static const ps_out_t* find_out_spec(con
>  {
>         unsigned i;
>         for (i = 0; i < ARRAY_SIZE(out_spec); i++) {
>
> -               if (!strcmp(name, out_spec[i].name))
> +               if (!strncmp(name, out_spec[i].name6, 6))
>                         return &out_spec[i];
>         }

Only minor issue - when using strncmp instead of strcmp (and `name6'
sized 7) for ps parameters , options such as "ps -o rgroup123" are
also allowed - which may or may not be a problem.

> Apart from whitespace damage, the following is questionable:
>
> + long niceness;
>
> Why long?

By man proc(5) it should be long - though, thinking about it, is
doesn't any sense at all, it can be int.


David.


More information about the busybox mailing list