From 315a4eed93bc4e8c52b3974a556fd96870e8f95b Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 10 Dec 2013 20:22:46 +0100 Subject: Include header file for isspace. Fix flag MAP_PRIVATE, it is not default, if 0 is given --- el.c | 1 + mystdlib.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/el.c b/el.c index f615b5c..40dccbd 100644 --- a/el.c +++ b/el.c @@ -6,6 +6,7 @@ #include #include "mystdlib.h" #include +#include // Our index into the already scanned lines. // memory buffer is estimated to 1/32th of the diff --git a/mystdlib.c b/mystdlib.c index b53beca..56edcb9 100644 --- a/mystdlib.c +++ b/mystdlib.c @@ -22,7 +22,7 @@ MAP map_file( char *filename, int readonly ) { fstat( map->fh, &fstatus ); if( ( map->addr = mmap( NULL, map->size = (size_t)fstatus.st_size, - PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? 0 : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) + PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? MAP_PRIVATE : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) { fprintf( stderr, "Mapping file '%s' failed\n", filename ); close( map->fh ); free( map ); map = NULL; -- cgit v1.2.3