aboutsummaryrefslogtreecommitdiff
path: root/bfd/cache.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-04-11 16:49:09 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-04-11 16:49:09 -0700
commit263b1a3c1f9be7a3bafdb26d69f808974f886680 (patch)
tree3dd2bcadab223fc4c0f8d0d6954ec275a5ffc702 /bfd/cache.c
parent2c008f9a5b65fe8d9379e761b056fabeb34a5da6 (diff)
downloadgdb-263b1a3c1f9be7a3bafdb26d69f808974f886680.zip
gdb-263b1a3c1f9be7a3bafdb26d69f808974f886680.tar.gz
gdb-263b1a3c1f9be7a3bafdb26d69f808974f886680.tar.bz2
Don't call getpagesize more than once
Diffstat (limited to 'bfd/cache.c')
-rw-r--r--bfd/cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/cache.c b/bfd/cache.c
index 67d3d17..a0a02e4 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -497,7 +497,8 @@ bfd_cache_init (bfd *abfd)
return FALSE;
}
#ifdef HAVE_MMAP
- pagesize_m1 = getpagesize () - 1;
+ if (pagesize_m1 == 0)
+ pagesize_m1 = getpagesize () - 1;
#endif
abfd->iovec = &cache_iovec;
insert (abfd);