sandbox: Update os_open() to return an error code

It is convenient to be able to report the system error when available.
Update os_open() to return it.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-06-25 06:44:50 -06:00
parent 8abb925523
commit ddaa12e605
6 changed files with 15 additions and 11 deletions

View File

@@ -171,7 +171,7 @@ static int sandbox_sf_probe(struct udevice *dev)
memset(sandbox_sf_0xff, 0xff, sizeof(sandbox_sf_0xff));
sbsf->fd = os_open(pdata->filename, 02);
if (sbsf->fd == -1) {
if (sbsf->fd < 0) {
printf("%s: unable to open file '%s'\n", __func__,
pdata->filename);
ret = -EIO;