mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Baruch Siach <baruch@tkos.co.il>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] bootz: give a proper error on open() failure
Date: Thu, 22 Jul 2010 15:38:16 +0200	[thread overview]
Message-ID: <20100722133816.GM14113@pengutronix.de> (raw)
In-Reply-To: <663c1d5bbf018d889bd085f508d14e8e104b6430.1279783784.git.baruch@tkos.co.il>

Hi Baruch,

On Thu, Jul 22, 2010 at 10:30:34AM +0300, Baruch Siach wrote:
> Currently when running bootz on a nonexistent file, barebox just got stuck. Fix
> this.

Applied to -master.

Thanks
 Sascha

> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  arch/arm/lib/armlinux.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index 89d989a..17ae057 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -34,6 +34,7 @@
>  #include <xfuncs.h>
>  #include <malloc.h>
>  #include <fcntl.h>
> +#include <errno.h>
>  
>  #include <asm/byteorder.h>
>  #include <asm/global_data.h>
> @@ -276,6 +277,10 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])
>  	}
>  
>  	fd = open(argv[1], O_RDONLY);
> +	if (fd < 0) {
> +		perror("open");
> +		return 1;
> +	}
>  
>  	ret = read(fd, &header, sizeof(header));
>  	if (ret < sizeof(header)) {
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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

      reply	other threads:[~2010-07-22 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22  7:30 Baruch Siach
2010-07-22 13:38 ` 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=20100722133816.GM14113@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=baruch@tkos.co.il \
    /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