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;