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 <yamada.masahiro@socionext.com>
This commit is contained in:
Masahiro Yamada 2020-07-09 23:05:45 +09:00
parent 99c447f440
commit 6eb75a1a2f
1 changed files with 1 additions and 1 deletions

View File

@ -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 */