[BusyBox] [PATCH] kill error message

Rob Landley rob at landley.net
Tue Aug 16 17:08:04 UTC 2005


On Monday 15 August 2005 02:27, Vladimir N. Oleynik wrote:
> Rob,
>
> >> The attached patch fixes the error message when trying to kill a
> >> non-existing pid in ash
> >>
> >> BEFORE
> >> # kill 1234
> >> kill: 1: m
>
> I do not know, you use what libc, but the busybox project in many places
> uses "%m" opportunity.

%m is a glibc extension.  uClibc has an option to implement it, from 
menuconfig in uClibc 0.9.27:

UCLIBC_HAS_PRINTF_M_SPEC: 
  │ 
  │ Answer Y to support a glibc extension to interpret '%m' in printf
  │ format strings as an instruction to output the error message string
  │ (as generated by strerror) corresponding to the current value of 'errno
  │ 
  │ Most people will answer N.

> >> AFTER
> >> # kill 1234
> >> kill: 3: kill 1234: No such process
>
> Really to like you here this result?

Assuming your translator program meant something like "Do you really like this 
result"?  The answer is "I personally don't strongly care one way or the 
other".

> > Applied to both 1.1 and -stable.
>
> Return back as was!

Ordinarily, we'd handle this by using one of the forest of libbb macros like 
"bb_perror_msg" or some such.  However, looking more closely at ash, this 
sucker is _not_ particularly busyboxified, is it? sh_warnx()?  va_end() twice 
after /*NOTREACHED*/?  And presumably doing the same thing as the busybox 
macros...

It seems ash needs a larger cleanup (as does libbb, really.  Trying to figure 
out the difference between error_msg.c and perror_msg.c is not for the faint 
of heart...)

I need to write a new shell.  I wonder where I'd get test cases for one?

> --w
> vodz

Rob



More information about the busybox mailing list