summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-03-23 12:15:22 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-23 12:15:22 +0100
commitbb2873db3ef11e7b1299b1cca129f5d002e47f59 (patch)
treee53a1697f6ffb81d8f866ddadf3862ab0c04ceef /scripts
parent31343957ea42a9340345c17288e56cfa07304bb8 (diff)
parent176bd2605edfd7d64370736abe8c44833068788b (diff)
downloadbarebox-bb2873db3ef11e7b1299b1cca129f5d002e47f59.tar.gz
barebox-bb2873db3ef11e7b1299b1cca129f5d002e47f59.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'scripts')
-rw-r--r--scripts/imx/imx-image.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index 6cbee1d9bd..3e277e82fa 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -985,9 +985,18 @@ int main(int argc, char *argv[])
}
if (add_barebox_header) {
- pwrite(outfd, bb_header, sizeof_bb_header, 0);
- if (data.cpu_type == IMX_CPU_IMX35)
- pwrite(outfd, bb_header, sizeof_bb_header, header_len);
+ ret = pwrite(outfd, bb_header, sizeof_bb_header, 0);
+ if (ret < 0) {
+ fprintf(stderr, "pwrite failed: %s\n", strerror(errno));
+ exit(1);
+ }
+ if (data.cpu_type == IMX_CPU_IMX35) {
+ ret = pwrite(outfd, bb_header, sizeof_bb_header, header_len);
+ if (ret < 0) {
+ fprintf(stderr, "pwrite failed: %s\n", strerror(errno));
+ exit(1);
+ }
+ }
}
xwrite(outfd, infile, insize);