diff options
author | Andre Przywara <andre.przywara@arm.com> | 2019-06-30 04:45:01 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-18 18:31:26 +0300 |
commit | 849f9bef429dd1a2eabaf93bef2bd3442b4e0829 (patch) | |
tree | 4a5984aa39f6be0979face2aed27e2d4895ffc8a /cmd/Kconfig | |
parent | 40e7b3ce74e32798e742725d743e484f11766ba4 (diff) | |
download | u-boot-849f9bef429dd1a2eabaf93bef2bd3442b4e0829.tar.xz |
tools: mkenvimage: Always consider non-regular files
At the moment mkenvimage has two separate read paths: One to read from
a potential pipe, while dynamically increasing the buffer size, and a
second one using mmap(2), using the input file's size. This is
problematic for two reasons:
- The "pipe" path will be chosen if the input filename is missing or
"-". Any named, but non-regular file will use the other path, which
typically will cause mmap() to fail:
$ mkenvimage -s 256 -o out <(echo "foo=bar")
- There is no reason to have *two* ways of reading a file, since the
"pipe way" will always work, even for regular files.
Fix this (and simplify the code on the way) by always using the method
of dynamically resizing the buffer. The existing distinction between
the two cases will merely be used to use the open() syscall or not.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'cmd/Kconfig')
0 files changed, 0 insertions, 0 deletions