[prev in list] [next in list] [prev in thread] [next in thread] 

List:       u-boot
Subject:    [PATCH V2 1/7] tools: imx8mimage: not abort when mmap fail
From:       "Peng Fan (OSS)" <peng.fan () oss ! nxp ! com>
Date:       2021-10-08 3:29:38
Message-ID: 20211008040534.30998-2-peng.fan () oss ! nxp ! com
[Download RAW message or body]

From: Peng Fan <peng.fan@nxp.com>

When creating flash.bin, the hdmi firmware might not be
copied to U-Boot source tree. Then mkimage will fail.
However we are switching to binman, binman will show the
message if the file not there, and create empty file per
i.MX8MQ binman node. So we not fail mkimage here othersize
CI will fail if hdmi firmware not copied here.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 tools/imx8mimage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c
index 11e40ccd94..4eed683396 100644
--- a/tools/imx8mimage.c
+++ b/tools/imx8mimage.c
@@ -271,7 +271,7 @@ static void copy_file(int ifd, const char *datafile, int pad, int offset,
 	if (ptr == MAP_FAILED) {
 		fprintf(stderr, "Can't read %s: %s\n",
 			datafile, strerror(errno));
-		exit(EXIT_FAILURE);
+		goto err_mmap;
 	}
 
 	size = sbuf.st_size - datafile_offset;
@@ -311,6 +311,7 @@ static void copy_file(int ifd, const char *datafile, int pad, int offset,
 	}
 
 	munmap((void *)ptr, sbuf.st_size);
+err_mmap:
 	close(dfd);
 }
 
-- 
2.30.0

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic