what meaning of command function return val

Sascha Hauer s.hauer at pengutronix.de
Tue Dec 4 02:42:32 EST 2012


On Tue, Dec 04, 2012 at 10:54:54AM +0800, 张忠山 wrote:
> When write a command function do_xxx.
> 
> When all right it should return zero.
> 
> But when error, It should return a negtive value or a positive value?
> And what difference between neg-val and pos-val?

Traditionally only positive error values were supported. This was
changed recently so you can return negative error codes now. The
difference is that with negative error values barebox will print
a string representation of the error code. If that's suitable for
your command I suggest to return negative codes.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list