]> git.dujemihanovic.xyz Git - u-boot.git/commit
sandbox: Return error code from read/write/seek
authorSimon Glass <sjg@chromium.org>
Wed, 7 Aug 2024 22:47:24 +0000 (16:47 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 9 Aug 2024 22:03:19 +0000 (16:03 -0600)
commitb254a8359ecdc8ec85cd93e055c6bbeee259df1d
treeef8e14b921dd1a74ac6214844a0547a71b788bc8
parentd8289e7dfe5541dfef59520917d81cd39e10c8f3
sandbox: Return error code from read/write/seek

The existing API for these functions is different from the rest of
U-Boot, in that any error code must be obtained from the errno variable
on failure. This variable is part of the C library, so accessing it
outside of the special 'sandbox' shim-functions is not ideal.

Adjust the API to return an error code, to avoid this. Update existing
uses to check for any negative value, rather than just -1.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/os.c
arch/sandbox/cpu/spl.c
drivers/block/sandbox.c
drivers/usb/emul/sandbox_flash.c
fs/sandbox/sandboxfs.c
include/os.h