diff options
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $ */ +/* $NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $"); +__RCSID("$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -490,7 +490,7 @@ loadfile(const char *path, int fd) { struct loadedfile *lf; #ifdef HAVE_MMAP - long pagesize; + static long pagesize = 0; #endif ssize_t result; size_t bufpos; @@ -515,9 +515,8 @@ loadfile(const char *path, int fd) if (load_getsize(fd, &lf->len) == SUCCESS) { /* found a size, try mmap */ #ifdef _SC_PAGESIZE - pagesize = sysconf(_SC_PAGESIZE); -#else - pagesize = 0; + if (pagesize == 0) + pagesize = sysconf(_SC_PAGESIZE); #endif if (pagesize <= 0) { pagesize = 0x1000; @@ -720,6 +719,8 @@ ParseVErrorInternal(FILE *f, const char *cfname, size_t clineno, int type, (void)vfprintf(f, fmt, ap); (void)fprintf(f, "\n"); (void)fflush(f); + if (type == PARSE_INFO) + return; if (type == PARSE_FATAL || parseWarnFatal) fatals += 1; if (parseWarnFatal && !fatal_warning_error_printed) { @@ -812,7 +813,7 @@ ParseMessage(char *line) switch(*line) { case 'i': - mtype = 0; + mtype = PARSE_INFO; break; case 'w': mtype = PARSE_WARNING; |