Skip to content

Commit

Permalink
Added detail about why a file couldn't be opened (thanks mgerhardy!)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 6, 2024
1 parent 8f5d3ca commit 1512013
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/file/SDL_rwops.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#ifdef HAVE_STDIO_H
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#endif
#ifdef HAVE_LIMITS_H
Expand Down Expand Up @@ -632,7 +633,7 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
FILE *fp = fopen(file, mode);
#endif
if (!fp) {
SDL_SetError("Couldn't open %s", file);
SDL_SetError("Couldn't open %s: %s", file, strerror(errno));
} else if (!IsRegularFileOrPipe(fp)) {
fclose(fp);
fp = NULL;
Expand Down

0 comments on commit 1512013

Please sign in to comment.