Re: what meaning of command function return val

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux