This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Don't call getpagesize more than once
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 11 Apr 2015 23:49:42 -0000
- Subject: [binutils-gdb] Don't call getpagesize more than once
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=263b1a3c1f9be7a3bafdb26d69f808974f886680
commit 263b1a3c1f9be7a3bafdb26d69f808974f886680
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Apr 11 16:49:09 2015 -0700
Don't call getpagesize more than once
Diff:
---
bfd/cache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);