From 8468c372b21b937d7adb340c4725d77c7d87c4d9 Mon Sep 17 00:00:00 2001 From: Petar Popovic Date: Sat, 26 Oct 2024 07:13:00 +0200 Subject: [PATCH] SDL_EnumerateDirectory(): (posix) Fix return value when directory is invalid --- src/filesystem/posix/SDL_sysfsops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/filesystem/posix/SDL_sysfsops.c b/src/filesystem/posix/SDL_sysfsops.c index 36f539257d..463bbb5689 100644 --- a/src/filesystem/posix/SDL_sysfsops.c +++ b/src/filesystem/posix/SDL_sysfsops.c @@ -40,8 +40,7 @@ bool SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enume DIR *dir = opendir(path); if (!dir) { - SDL_SetError("Can't open directory: %s", strerror(errno)); - return -1; + return SDL_SetError("Can't open directory: %s", strerror(errno)); } struct dirent *ent;