summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--el.c1
-rw-r--r--mystdlib.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/el.c b/el.c
index f615b5c..40dccbd 100644
--- a/el.c
+++ b/el.c
@@ -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
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 )
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;