[patch] exit status in msh
Jie Zhang
jie.zhang at analog.com
Wed May 14 08:11:16 UTC 2008
Hi,
msh returns wrong exit status for command that cannot execute correctly.
According to
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
[quote]
The exit status of a command that terminated because it received a
signal shall be reported as greater than 128.
[/quote]
The convention of bash is to return (128 + signal number). But msh
returns -1 in that case.
[quote]
If a command is not found, the exit status shall be 127. If the command
name is found, but it is not an executable utility, the exit status
shall be 126.
[/quote]
But msh returns 255 for both cases.
This patch should fix the first case. Please review and commit if OK.
Thanks,
Jie Zhang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-exit-status.diff
Type: text/x-diff
Size: 361 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080514/f8fe52ec/attachment.bin
More information about the busybox
mailing list