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

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;
}