diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2015-01-13 06:47:31 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-01-13 08:47:30 +0100 |
commit | 3f577105a6100276c9467ff54a0fb1feed269c9d (patch) | |
tree | f6f58ad35d6ac099cfaf2645c2c8308c8d5ffa33 /commands/splash.c | |
parent | 616b343493f632179d4fb699184d7481ca7c30fa (diff) | |
download | barebox-3f577105a6100276c9467ff54a0fb1feed269c9d.tar.gz barebox-3f577105a6100276c9467ff54a0fb1feed269c9d.tar.xz |
command/splash: fix return value
return errno when possible
otherwise return 0 for ok or 1 for error
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/splash.c')
-rw-r--r-- | commands/splash.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/commands/splash.c b/commands/splash.c index 2ce1bdda88..9bd84fbb2b 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); |