From 9c6112eb5bec5e66bff092e8131839f38a2be39b Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 24 Oct 2021 02:56:15 +0200 Subject: [PATCH] fopen_internal: return ENOENT on file not found This is actually expected by open(2), but I do not expect the BIOS implementation to conform. --- libpsx/src/libc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libpsx/src/libc.c b/libpsx/src/libc.c index 6e5c75d..7480825 100644 --- a/libpsx/src/libc.c +++ b/libpsx/src/libc.c @@ -177,6 +177,7 @@ static FILE *fopen_internal(const char *path, const char *mode, FILE *f) if(fd == -1) { + errno = ENOENT; if(s!=NULL)free(s); return NULL; }