[builds/unix, builds/vms] Standardize `mmap` failure.

* builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED.
* builds/vms/ftsystem.c (FT_Stream_Open): Ditto.

This should cover https://savannah.nongnu.org/patch/?5909 as well.
This commit is contained in:
Alexei Podtelezhnikov 2021-10-05 14:19:06 -04:00
parent 467e49e817
commit a156040600
2 changed files with 2 additions and 3 deletions

View File

@ -313,8 +313,7 @@
file,
0 );
/* on some RTOS, mmap might return 0 */
if ( (long)stream->base != -1 && stream->base != NULL )
if ( stream->base != MAP_FAILED )
stream->close = ft_close_stream_by_munmap;
else
{

View File

@ -246,7 +246,7 @@
file,
0 );
if ( (long)stream->base == -1 )
if ( stream->base == MAP_FAILED )
{
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));