pxe: Return the file size from the getfile() function
authorSimon Glass <sjg@chromium.org>
Thu, 14 Oct 2021 18:48:08 +0000 (12:48 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 12 Nov 2021 00:02:36 +0000 (19:02 -0500)
commit4d79e884adf6842beb94566bf5249c07a84a5b51
tree7eb943b038db3795e57cec8536553dbc959197e1
parent4a255ea3b65e7793eea97a90ad00dc2b59889683
pxe: Return the file size from the getfile() function

It is pretty strange that the pxe code uses the 'filesize' environment
variable find the size of a file it has just read.

Partly this is because it uses the command-line interpreter to parse its
request to load the file.

As a first step towards unwinding this, return it directly from the
getfile() function. This makes the code a bit longer, for now, but will be
cleaned up in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
boot/pxe_utils.c
cmd/pxe.c
cmd/sysboot.c
include/pxe_utils.h