diff options
-rw-r--r-- | el.c | 1 | ||||
-rw-r--r-- | mystdlib.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -6,6 +6,7 @@ | |||
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | #include "mystdlib.h" | 7 | #include "mystdlib.h" |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | #include <ctype.h> | ||
9 | 10 | ||
10 | // Our index into the already scanned lines. | 11 | // Our index into the already scanned lines. |
11 | // memory buffer is estimated to 1/32th of the | 12 | // memory buffer is estimated to 1/32th of the |
@@ -22,7 +22,7 @@ MAP map_file( char *filename, int readonly ) | |||
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 | if( ( map->addr = mmap( NULL, map->size = (size_t)fstatus.st_size, |
25 | PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? 0 : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) | 25 | PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? MAP_PRIVATE : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) |
26 | { | 26 | { |
27 | fprintf( stderr, "Mapping file '%s' failed\n", filename ); | 27 | fprintf( stderr, "Mapping file '%s' failed\n", filename ); |
28 | close( map->fh ); free( map ); map = NULL; | 28 | close( map->fh ); free( map ); map = NULL; |