[U-Boot] [U-Boot, RESEND, v5] fs/fs.c: read up to EOF when len would read past EOF

Tom Rini trini at konsulko.com
Thu Aug 13 15:23:34 CEST 2015


On Wed, Aug 05, 2015 at 05:16:58PM +0200, Marcel Ziswiler wrote:

> From: Max Krummenacher <max.krummenacher at toradex.com>
> 
> http://lists.denx.de/pipermail/u-boot/2012-September/134347.html
> allows for reading files in chunks from the shell.
> 
> When this feature is used to read past the end of a file an error
> was returned instead of returning the bytes read up to the end of
> file. Thus the following fails in the shell:
> 
> offset = 0
> len = chunksize
> do
> 	read file, offset, len
> 	write data
> until bytes_read < len
> 
> The patch changes the behaviour to printing an informational
> message and returning the actual read number of bytes aka read(2)
> behaviour for convenient use in U-Boot scripts.
> 
> Signed-off-by: Max Krummenacher <max.krummenacher at toradex.com>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> Acked-by: Marek Vasut <marex at denx.de>
> Signed-off-by: Stefan Agner <stefan.agner at toradex.com>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/5e8616cb/attachment.sig>


More information about the U-Boot mailing list