From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox <barebox@lists.infradead.org>
Subject: Re: what meaning of command function return val
Date: Tue, 4 Dec 2012 08:42:32 +0100 [thread overview]
Message-ID: <20121204074232.GU10369@pengutronix.de> (raw)
In-Reply-To: <20121204025454.GC20812@greatfirst.com>
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
prev parent reply other threads:[~2012-12-04 7:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 2:54 张忠山
2012-12-04 7:42 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121204074232.GU10369@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox