Merge pull request #145 from sunlollyking/libretro-file-open-std-streams

libretro: open stdout and stderr as the streams
This commit is contained in:
Craig authored and GitHub committed 2026-11-06 15:32:29 +00:00
commit 8f9c539c54
1 file changed
+8 -1
+8 -1
View File
@@ -162,6 +162,13 @@ FILE *File_Open(const char *path, const char *mode)
if (!path || !*path)
return NULL;
if (strcmp(path, "stdin") == 0)
return stdin;
if (strcmp(path, "stdout") == 0)
return stdout;
if (strcmp(path, "stderr") == 0)
return stderr;
/* Open a normal log file */
fp = fopen(path, mode);
if (!fp)
@@ -178,7 +185,7 @@ FILE *File_Open(const char *path, const char *mode)
*/
FILE *File_Close(FILE *fp)
{
if (fp)
if (fp && fp != stdin && fp != stdout && fp != stderr)
fclose(fp);
return NULL;