summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--preconv.c9
-rw-r--r--read.c9
-rw-r--r--test-mmap.c2
3 files changed, 6 insertions, 14 deletions
diff --git a/preconv.c b/preconv.c
index b2f031bc..3c7d81f3 100644
--- a/preconv.c
+++ b/preconv.c
@@ -32,13 +32,9 @@
/*
* The read_whole_file() and resize_buf() functions are copied from
- * read.c, including all dependency code (MAP_FILE, etc.).
+ * read.c, including all dependency code.
*/
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
enum enc {
ENC_UTF_8, /* UTF-8 */
ENC_US_ASCII, /* US-ASCII */
@@ -271,8 +267,7 @@ read_whole_file(const char *f, int fd,
if (S_ISREG(st.st_mode)) {
*with_mmap = 1;
fb->sz = (size_t)st.st_size;
- fb->buf = mmap(NULL, fb->sz, PROT_READ,
- MAP_FILE|MAP_SHARED, fd, 0);
+ fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0);
if (fb->buf != MAP_FAILED)
return(1);
}
diff --git a/read.c b/read.c
index 7cb2c128..54d26eb6 100644
--- a/read.c
+++ b/read.c
@@ -40,10 +40,6 @@
#include "man.h"
#include "main.h"
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
#define REPARSE_LIMIT 1000
struct buf {
@@ -74,6 +70,8 @@ static void mparse_buf_r(struct mparse *, struct buf, int);
static void pset(const char *, int, struct mparse *);
static int read_whole_file(const char *, int, struct buf *, int *);
static void mparse_end(struct mparse *);
+static void mparse_parse_buffer(struct mparse *, struct buf,
+ const char *);
static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = {
MANDOCERR_OK,
@@ -595,8 +593,7 @@ read_whole_file(const char *file, int fd, struct buf *fb, int *with_mmap)
}
*with_mmap = 1;
fb->sz = (size_t)st.st_size;
- fb->buf = mmap(NULL, fb->sz, PROT_READ,
- MAP_FILE|MAP_SHARED, fd, 0);
+ fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0);
if (fb->buf != MAP_FAILED)
return(1);
}
diff --git a/test-mmap.c b/test-mmap.c
index db8fd873..1e0f9422 100644
--- a/test-mmap.c
+++ b/test-mmap.c
@@ -5,6 +5,6 @@ int
main(int argc, char **argv)
{
- mmap(0, 0, PROT_READ, MAP_FILE|MAP_SHARED, -1, 0);
+ mmap(0, 0, PROT_READ, MAP_SHARED, -1, 0);
return 0;
}