From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from tango.tkos.co.il ([62.219.50.35]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1ObqFO-0004iM-S5 for barebox@lists.infradead.org; Thu, 22 Jul 2010 07:31:15 +0000 From: Baruch Siach Date: Thu, 22 Jul 2010 10:30:34 +0300 Message-Id: <663c1d5bbf018d889bd085f508d14e8e104b6430.1279783784.git.baruch@tkos.co.il> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] bootz: give a proper error on open() failure To: barebox@lists.infradead.org Currently when running bootz on a nonexistent file, barebox just got stuck. Fix this. Signed-off-by: Baruch Siach --- 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 #include #include +#include #include #include @@ -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