aboutsummaryrefslogtreecommitdiff
path: root/libio/iofopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofopen.c')
-rw-r--r--libio/iofopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libio/iofopen.c b/libio/iofopen.c
index 00a2c5f073..8cd68a3690 100644
--- a/libio/iofopen.c
+++ b/libio/iofopen.c
@@ -41,7 +41,7 @@ __fopen_maybe_mmap (fp)
_IO_FILE *fp;
{
#ifdef _G_HAVE_MMAP
- if (fp->_flags & _IO_NO_WRITES)
+ if ((fp->_flags2 & _IO_FLAGS2_MMAP) && (fp->_flags & _IO_NO_WRITES))
{
/* Since this is read-only, we might be able to mmap the contents
directly. We delay the decision until the first read attempt by