aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-07-19 21:31:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-07-19 21:31:55 +0000
commit490252b369661e1862919f425cdaf44accbeb1ae (patch)
tree8a0b59b3e70291eee1659e8a3fa736fd5f16f6a4 /read.c
parente5f4a3c1625e925c77bedecad81068d453990bc5 (diff)
downloadmandoc-490252b369661e1862919f425cdaf44accbeb1ae.tar.gz
mandoc-490252b369661e1862919f425cdaf44accbeb1ae.tar.zst
mandoc-490252b369661e1862919f425cdaf44accbeb1ae.zip
Remove the dependency on SQLite without loss of functionality.
Stop supporting systems that don't have mmap(3). Drop the obsolete names_check() now that we deleted MLINKS.
Diffstat (limited to 'read.c')
-rw-r--r--read.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/read.c b/read.c
index e516cdaf..21d28b0b 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.150 2016/07/19 16:22:52 schwarze Exp $ */
+/* $Id: read.c,v 1.151 2016/07/19 21:31:55 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -19,10 +19,8 @@
#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>
@@ -598,7 +596,6 @@ 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)
@@ -622,7 +619,6 @@ 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)
@@ -747,11 +743,9 @@ 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;