[binutils-gdb] Don't call getpagesize more than once

H.J.Lu hjl@sourceware.org
Sat Apr 11 23:49:00 GMT 2015


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);



More information about the Binutils-cvs mailing list