From 6eb75a1a2febdf089c2a432dc46c94a0da16520d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 9 Jul 2020 23:05:45 +0900 Subject: [PATCH] io_fip: return -ENFILE when a file is already open The cause of failure is not memory shortage. The comment for ENFILE in include/lib/libc/errno.h /* Too many open files in system */ ... is a better match to the warning message here. Change-Id: I45a1740995d464edd8b3e32b93f1f92ba17e5874 Signed-off-by: Masahiro Yamada --- drivers/io/io_fip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c index 02f85d603..7aa717da8 100644 --- a/drivers/io/io_fip.c +++ b/drivers/io/io_fip.c @@ -302,7 +302,7 @@ static int fip_file_open(io_dev_info_t *dev_info, const uintptr_t spec, */ if (current_file.entry.offset_address != 0) { WARN("fip_file_open : Only one open file at a time.\n"); - return -ENOMEM; + return -ENFILE; } /* Attempt to access the FIP image */