Author: bdrewery
Date: Wed Sep 17 20:26:27 2014
New Revision: 271723
URL: http://svnweb.freebsd.org/changeset/base/271723

Log:
  Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635.
  
  X-MFC-With:   r271635
  Reviewed by:  jhb

Modified:
  head/lib/libc/gen/nlist.c

Modified: head/lib/libc/gen/nlist.c
==============================================================================
--- head/lib/libc/gen/nlist.c   Wed Sep 17 19:45:34 2014        (r271722)
+++ head/lib/libc/gen/nlist.c   Wed Sep 17 20:26:27 2014        (r271723)
@@ -268,7 +268,7 @@ __elf_fdnlist(fd, list)
        }
 
        /* mmap section header table */
-       base = mmap(NULL, (size_t)shdr_size, PROT_READ, 0, fd,
+       base = mmap(NULL, (size_t)shdr_size, PROT_READ, MAP_PRIVATE, fd,
            (off_t)ehdr.e_shoff);
        if (base == MAP_FAILED)
                return (-1);
@@ -301,7 +301,7 @@ __elf_fdnlist(fd, list)
         * making the memory allocation permanent as with malloc/free
         * (i.e., munmap will return it to the system).
         */
-       base = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd,
+       base = mmap(NULL, (size_t)symstrsize, PROT_READ, MAP_PRIVATE, fd,
            (off_t)symstroff);
        if (base == MAP_FAILED)
                goto done;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to