aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-06-02 03:52:21 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-06-02 03:52:21 +0000
commite8e61026ee843cd18956b5932414c606fa85390c (patch)
tree0f8ac032ad659fe8cdbd0394a22387f7c37b8fff /read.c
parenta9b16812c6c127416d84f1714ec937066b0a77fb (diff)
downloadmandoc-e8e61026ee843cd18956b5932414c606fa85390c.tar.gz
mandoc-e8e61026ee843cd18956b5932414c606fa85390c.tar.zst
mandoc-e8e61026ee843cd18956b5932414c606fa85390c.zip
Sync to OpenBSD, no functional change:
* Add the missing mparse_parse_buffer prototype. * Drop the useless MAP_FILE constant: It's not specified in POSIX, so it's not required, it's the default anyway, and it's 0 anyway.
Diffstat (limited to 'read.c')
-rw-r--r--read.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/read.c b/read.c
index 5fba2fea..fce90924 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.36 2013/06/01 22:57:35 schwarze Exp $ */
+/* $Id: read.c,v 1.37 2013/06/02 03:52:21 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}