mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] command/splash: fix return value
Date: Tue, 13 Jan 2015 06:47:31 +0100	[thread overview]
Message-ID: <1421128051-6505-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1421128051-6505-1-git-send-email-plagnioj@jcrosoft.com>

return errno when possible

otherwise return 0 for ok or 1 for error

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 commands/splash.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/commands/splash.c b/commands/splash.c
index 2ce1bdd..9bd84fb 100644
--- a/commands/splash.c
+++ b/commands/splash.c
@@ -11,7 +11,8 @@ static int do_splash(int argc, char *argv[])
 {
 	struct surface s;
 	struct screen sc;
-	int ret, opt, fd;
+	int ret = 0;
+	int opt, fd;
 	char *fbdev = "/dev/fb0";
 	char *image_file;
 	int offscreen = 0;
@@ -54,7 +55,7 @@ static int do_splash(int argc, char *argv[])
 	fd = fb_open(fbdev, &sc, offscreen);
 	if (fd < 0) {
 		perror("fd_open");
-		return 1;
+		return fd;
 	}
 
 	if (sc.offscreenbuf) {
@@ -67,8 +68,9 @@ static int do_splash(int argc, char *argv[])
 		memset_pixel(&sc.info, sc.fb, bg_color, sc.s.width * sc.s.height);
 	}
 
-	if (image_renderer_file(&sc, &s, image_file) < 0)
-		ret = 1;
+	ret = image_renderer_file(&sc, &s, image_file);
+	if (ret > 0)
+		ret = 0;
 
 	screen_blit(&sc);
 
-- 
2.1.3


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

  reply	other threads:[~2015-01-13  5:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  5:47 [PATCH 1/2] kconfig/menu.c:590: fix warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized] Jean-Christophe PLAGNIOL-VILLARD
2015-01-13  5:47 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2015-01-13  7:47 ` Sascha Hauer

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=1421128051-6505-2-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --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