aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@wasabisystems.com>2004-03-15 22:47:57 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-03-15 14:47:57 -0800
commit4e4083addf86633dc7b78cc5e5449bb0e6ad37ae (patch)
tree1c68f2a4e4fed6295e32c116aea91c381a4e0ca0
parent74a568a4c57b8d8af0926448bf793fc13d4fa1dc (diff)
downloadgcc-4e4083addf86633dc7b78cc5e5449bb0e6ad37ae.zip
gcc-4e4083addf86633dc7b78cc5e5449bb0e6ad37ae.tar.gz
gcc-4e4083addf86633dc7b78cc5e5449bb0e6ad37ae.tar.bz2
host-darwin.c (darwin_rs6000_gt_pch_use_address): Fix the check for abort and only do the mmap if we can.
2004-03-15 Ian Lance Taylor <ian@wasabisystems.com> * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): Fix the check for abort and only do the mmap if we can. From-SVN: r79512
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/host-darwin.c19
2 files changed, 16 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1f60368..458ae13 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-15 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address):
+ Fix the check for abort and only do the mmap if we can.
+
2004-03-15 Eric Botcazou <ebotcazou@act-europe.fr>
* config/sparc/sparc.h: Rework comments about the code model
diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c
index e626304..9f47cac 100644
--- a/gcc/config/rs6000/host-darwin.c
+++ b/gcc/config/rs6000/host-darwin.c
@@ -180,16 +180,19 @@ darwin_rs6000_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off)
if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0)
fatal_error ("couldn't unmap pch_address_space: %m\n");
- mmap_result = mmap (addr, sz,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
- fd, off);
+ if (ret)
+ {
+ mmap_result = mmap (addr, sz,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
+ fd, off);
- /* The file might not be mmap-able. */
- ret = mmap_result == (void *) MAP_FAILED;
+ /* The file might not be mmap-able. */
+ ret = mmap_result == (void *) MAP_FAILED;
- /* Sanity check for broken MAP_FIXED. */
- if (ret && mmap_result != addr)
- abort ();
+ /* Sanity check for broken MAP_FIXED. */
+ if (!ret && mmap_result != addr)
+ abort ();
+ }
return ret;
}