diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2013-12-10 20:22:46 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2013-12-10 20:22:46 +0100 |
commit | 315a4eed93bc4e8c52b3974a556fd96870e8f95b (patch) | |
tree | cb75c0e0e1c0e5485614b6aa1b48262838b47a90 | |
parent | 46c13717ee5c439fd180f6de2138011914c64780 (diff) |
Include header file for isspace. Fix flag MAP_PRIVATE, it is not default, if 0 is given
-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; |