diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c581bdf197c..7af16e02a4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Sat 16-Sep-2000 19:14:00 BST Laurynas Biveinis + + * cppfiles.c (purge_cache): use munmap() only if MMAP_THRESHOLD + defined. + (read_include_file): Ensure inc->mmaped is initialized. + 2000-09-16 Richard Henderson * cppiles.c (purge_cache): Use PTR not caddr_t. diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 6b99b616e06..ffb46d26b1f 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -272,6 +272,7 @@ read_include_file (pfile, inc) } size = inc->st.st_size; + inc->mapped = 0; #if MMAP_THRESHOLD if (pagesize == -1) pagesize = getpagesize (); @@ -300,7 +301,6 @@ read_include_file (pfile, inc) } offset += count; } - inc->mapped = 0; } } else if (S_ISBLK (inc->st.st_mode)) @@ -363,9 +363,11 @@ purge_cache (inc) { if (inc->buffer) { +#if MMAP_THRESHOLD if (inc->mapped) munmap ((PTR) inc->buffer, inc->st.st_size); else +#endif free ((PTR) inc->buffer); inc->buffer = NULL; }