summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorAndrej Picej <andrej.picej@norik.com>2022-01-28 09:00:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-01-31 10:19:27 +0100
commit738601e1258c55953284ee10801b26b9977918c2 (patch)
treefcebc7e92bc10f11e3006801858680aef6e33604 /drivers/pinctrl
parent6a1bd66e15a96bedd0625bdee9ca10d78c908df8 (diff)
downloadbarebox-738601e1258c55953284ee10801b26b9977918c2.tar.gz
barebox-738601e1258c55953284ee10801b26b9977918c2.tar.xz
scripts/common: fix write_file when opened with mmap
Usage of bareboximd with -c option (Create checksum for FILE and write it to the crc32 tag) was broken. Possibly by applying 2154de1cf36c (bareboximd: Use mmap when possibly). The script fails with: $ ./scripts/bareboximd -c images/<barebox-image.img> Cannot write to images/<barebox-mage.img>: Bad address CRC: write crc token to images/<barebox-image.img> failed: -14 Bad address This has to do with the usage of "mmap" and "open" with O_TRUNC flag which truncates the file length to 0. Writing to files fails with: EFAULT (14) buf is outside your accessible address space. Remove the truncate flag and truncate manually after writing the data. This fixes the bareboximd script, which is now again usable with -c option. Signed-off-by: Anze Lesnik <anze.lesnik@norik.com> Signed-off-by: Andrej Picej <andrej.picej@norik.com> Link: https://lore.barebox.org/20220128080033.167251-1-andrej.picej@norik.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/pinctrl')
0 files changed, 0 insertions, 0 deletions