diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2019-06-29 18:51:00 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2019-06-29 18:51:00 +0200 |
commit | fb3616e06ca20ffe78dfb00b962a2599a46b2a5f (patch) | |
tree | fe7ad54e8cb17174b3296b63f41ad1f5b1038f8e /src/export/mystdlib.c | |
parent | b4bf8417af0d8ebff2c50570c70fdecaf6a53ed9 (diff) |
Clean up 1992 post processing
Diffstat (limited to 'src/export/mystdlib.c')
-rw-r--r-- | src/export/mystdlib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/export/mystdlib.c b/src/export/mystdlib.c index b65f63d..31c991e 100644 --- a/src/export/mystdlib.c +++ b/src/export/mystdlib.c | |||
@@ -21,7 +21,9 @@ MAP map_file( char *filename, int readonly ) | |||
21 | if( ( map->fh = open( filename, readonly ? O_RDONLY : O_RDWR ) ) >= 0 ) | 21 | if( ( map->fh = open( filename, readonly ? O_RDONLY : O_RDWR ) ) >= 0 ) |
22 | { | 22 | { |
23 | fstat( map->fh, &fstatus ); | 23 | fstat( map->fh, &fstatus ); |
24 | if( ( map->addr = mmap( NULL, map->size = (size_t)fstatus.st_size, | 24 | map->size = (size_t)fstatus.st_size; |
25 | if (!map->size) return map; | ||
26 | if( ( map->addr = mmap( NULL, map->size, | ||
25 | PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? MAP_PRIVATE : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) | 27 | PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? MAP_PRIVATE : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) |
26 | { | 28 | { |
27 | fprintf( stderr, "Mapping file '%s' failed\n", filename ); | 29 | fprintf( stderr, "Mapping file '%s' failed\n", filename ); |