Skip to content
Commit eaa6442e authored by Thomas Hebb's avatar Thomas Hebb Committed by Tom Rini
Browse files

mkimage: clarify error message for empty input files



Currently, an empty imput file causes `mmap()` to fail, and you get an
error like "mkimage: Can't read file.img: Invalid argument", which is
extremely unintuitive and hard to diagnose if you don't know what to
look for. Add an explicit check for an empty file and provide a clear
error message instead.

We already bounds check the image size when listing and re-signing
existing images, so we only need this check here, when opening data
files going into a image.

Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 295ab733
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment