]> git.cameronkatri.com Git - mandoc.git/commitdiff
Add MAP_SHARED for mmap, at least NetBSD with DIAGNOSTIC is quite noisy
authorJoerg Sonnenberger <joerg@netbsd.org>
Sun, 6 Jun 2010 20:44:53 +0000 (20:44 +0000)
committerJoerg Sonnenberger <joerg@netbsd.org>
Sun, 6 Jun 2010 20:44:53 +0000 (20:44 +0000)
otherwise.

main.c

diff --git a/main.c b/main.c
index 2a2bd386c84910bd4fa237db35ee9f65669d2731..313a167960b90e0f5a8637ba3a2fff35ba1d4f6f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/*     $Id: main.c,v 1.82 2010/06/03 13:44:36 kristaps Exp $ */
+/*     $Id: main.c,v 1.83 2010/06/06 20:44:53 joerg Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -395,7 +395,7 @@ read_whole_file(struct curparse *curp, 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, curp->fd, 0);
+                               MAP_FILE|MAP_SHARED, curp->fd, 0);
                if (fb->buf != MAP_FAILED)
                        return(1);
        }