mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* what meaning of command function return val
@ 2012-12-04  2:54 张忠山
  2012-12-04  7:42 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: 张忠山 @ 2012-12-04  2:54 UTC (permalink / raw)
  To: barebox

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?

-- 
Best Regards,
zzs



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: what meaning of command function return val
  2012-12-04  2:54 what meaning of command function return val 张忠山
@ 2012-12-04  7:42 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-12-04  7:42 UTC (permalink / raw)
  To: barebox

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-04  7:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04  2:54 what meaning of command function return val 张忠山
2012-12-04  7:42 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox