diff options
author | Andre Przywara <andre.przywara@arm.com> | 2019-06-30 02:45:00 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-18 11:31:26 -0400 |
commit | 40e7b3ce74e32798e742725d743e484f11766ba4 (patch) | |
tree | 816aaa17c8516213821b69fefee5f1515fdc3d3c /doc/driver-model/fdt-fixup.txt | |
parent | bdfc9e8ad7e39060e60c04b882dfb2c023a689b4 (diff) | |
download | u-boot-40e7b3ce74e32798e742725d743e484f11766ba4.zip u-boot-40e7b3ce74e32798e742725d743e484f11766ba4.tar.gz u-boot-40e7b3ce74e32798e742725d743e484f11766ba4.tar.bz2 |
tools: mkenvimage: Fix reading from slow pipe
It is perfectly fine for the read(2) syscall to return with less than
the requested number of bytes read (short read, see the "RETURN VALUE"
section of the man page). This typically happens with slow input
(keyboard, network) or with complex pipes.
So far mkenvimage expects the exact number of requested bytes to be
read, assuming an end-of-file condition otherwise. This wrong behaviour
can be easily shown with:
$ (echo "foo=bar"; sleep 1; echo "bar=baz") | mkenvimage -s 256 -o out -
The second line will be missing from the output.
Correct this by checking for any positive, non-zero return value.
This fixes a problem with a complex pipe in one of my scripts, where
the environment consist of two parts.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Alexander Dahl <ada@thorsis.com>
Diffstat (limited to 'doc/driver-model/fdt-fixup.txt')
0 files changed, 0 insertions, 0 deletions