9
0
Fork 0

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>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2015-01-13 06:47:31 +01:00 committed by Sascha Hauer
parent 616b343493
commit 3f577105a6
1 changed files with 6 additions and 4 deletions

View File

@ -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);