diff options
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -19,8 +19,10 @@ #include "config.h" #include <sys/types.h> +#if HAVE_MMAP #include <sys/mman.h> #include <sys/stat.h> +#endif #include <assert.h> #include <ctype.h> @@ -141,7 +143,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "empty argument, using 0n", "missing display type, using -ragged", "list type is not the first argument", - "missing -width in -tag list, using 8n", + "missing -width in -tag list, using 6n", "missing utility name, using \"\"", "missing function name, using \"\"", "empty head in list item", @@ -596,6 +598,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd, size_t off; ssize_t ssz; +#if HAVE_MMAP struct stat st; if (fstat(fd, &st) == -1) @@ -619,6 +622,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd, if (fb->buf != MAP_FAILED) return 1; } +#endif if (curp->gzip) { if ((gz = gzdopen(fd, "rb")) == NULL) @@ -743,9 +747,11 @@ mparse_readfd(struct mparse *curp, int fd, const char *file) (MPARSE_UTF8 | MPARSE_LATIN1); mparse_parse_buffer(curp, blk, file); curp->filenc = save_filenc; +#if HAVE_MMAP if (with_mmap) munmap(blk.buf, blk.sz); else +#endif free(blk.buf); } return curp->file_status; |