* mdocml: Sync to OpenBSD, no functional change: * Add the missing
@ 2013-06-02 3:52 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2013-06-02 3:52 UTC (permalink / raw)
To: source
Log Message:
-----------
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.
Modified Files:
--------------
mdocml:
preconv.c
read.c
test-mmap.c
Revision Data
-------------
Index: test-mmap.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/test-mmap.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltest-mmap.c -Ltest-mmap.c -u -p -r1.2 -r1.3
--- test-mmap.c
+++ 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;
}
Index: read.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/read.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -Lread.c -Lread.c -u -p -r1.36 -r1.37
--- read.c
+++ 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
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
}
*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);
}
Index: preconv.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/preconv.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lpreconv.c -Lpreconv.c -u -p -r1.5 -r1.6
--- preconv.c
+++ 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);
}
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-02 3:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-02 3:52 mdocml: Sync to OpenBSD, no functional change: * Add the missing schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).