[Toybox] [PATCH] Fix killall prompt.

enh enh at google.com
Wed Sep 9 18:49:07 PDT 2015


On Tue, Sep 8, 2015 at 3:06 PM, Rob Landley <rob at landley.net> wrote:
> On 09/07/2015 07:32 PM, enh wrote:
>> Fix killall prompt.
>>
>> I'm not sure how much we care, but the " ?" was deliberately done to
>> match the desktop.
>
> *squints*
>
> *tilts head*
>
> Do we _want_ a ? in the middle of the prompt? Yes, xubuntu's version is
> doing that, but... why?

(i suspect it's just because a question's not a question without a '?'.)

> Huh. No posix spec, LSB says -i but nothing about the prompt, man page
> doesn't describe it either...
>
>> Since I'm here, the desktop also switches between
>> "Kill" and "Signal" as the verb depending on the specific signal.
>> (Though the -v output always uses "kill".)
>
> Hmmm...
>
>   $ sleep 10000 &
>   $ killall -i15 sleep
>   [ help text dump, heh, good to know. ]
>   $ killall -i -15 sleep
>   Kill sleep(25653) ? (y/N) y
>
> So yes... that is the behavior it's doing, but...
>
>   $ killall -9 sleep -i
>   Signal sleep(4432) ? (y/N)
>
> kill -9 is signal, not kill? I wonder:
>
>   $ busybox killall -i -15 sleep
>   killall: bad signal name 'i'
>
> Riiight. That's today's git. "git log --follow */kill.c | cat" has the
> initial commit in 1999 (and that was a tree snapshot), so for at least
> 16 years nobody's ever bothered to implement -i.
>
> Digging out my old Red Hat 9 image from 2003 and booting it under
> qemu... (Last time I'm aware of that a single Linux distro had 50% of
> the Linux desktop was before Red Hat abandoned the desktop because it
> had figured out how to eat Sun's lunch, so I still occasionally pull it
> out as a historical frame of reference...) And that says "Kill" rather
> than "Signal" for -9 and -STOP, but otherwise has the weird ? in midstream.
>
> Right.
>
> You cared enough about this behavior to send me a patch, which means you
> care more than I do.

oh, i don't really care at all. i just read all the patches and
noticed that this one regressed our similarity with the reference
implementation. if we'd always been different i'd neither have noticed
(because i've never run killall -i other than to test this) and i
wouldn't have cared enough to send a patch even if i had.

(given how testable this is, if i'd cared i'd have included a test too :-) )

> I can apply this, it's a small inoffensive patch,
> but could you tell me why you want this before I do that? Did something
> actually need it, or just "it's different, therefore"...?
>
> Thanks,
>
> Rob
>
> (It's the aesthetic issues that are the hardest because there _is_ no
> right answer, just different ways to be wrong.)

yeah, which is why "do what the existing tool does" seems like a
reasonable default.

-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.

 1441849747.0


More information about the Toybox mailing list