mescc: Support binutils-2.14: fopen: Return 0 upon failure.

* lib/libc+tcc.c (fopen): Return 0 upon failure.
This commit is contained in:
Jan Nieuwenhuizen 2018-06-16 10:54:59 +02:00
parent 125b43acc8
commit 65d530f4ec
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 7 additions and 0 deletions

View File

@ -229,6 +229,13 @@ fopen (char const *file_name, char const *opentype)
eputs (" => fd="); eputs (itoa (fd)); eputs ("\n");
}
if (!fd)
{
eputs (" ***MES LIB C*** fopen of stdin: signal me in band\n");
exit (1);
}
if (fd < 0)
fd = 0;
return (FILE*)fd;
}