Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/libmudflap/testsuite/Makefile.in ('k') | gcc/libssp/Makefile.am » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c
diff --git a/gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c b/gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c
index 610be20554dc8a77ddf0f0f68f4cf1dffeea2238..fbeb6fd21d38699c064cd674ab10d12fc5871494 100644
--- a/gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c
+++ b/gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c
@@ -14,6 +14,9 @@ int main ()
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
#ifdef HAVE_MMAP
volatile unsigned char *p;
unsigned num = getpagesize ();
@@ -23,8 +26,8 @@ int main ()
/* Get a bit of usable address space. We really want an 2**N+1-sized object,
so the low/high addresses wrap when hashed into the lookup cache. So we
will manually unregister the entire mmap, then re-register a slice. */
- p = mmap (NULL, num, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
- if (p == NULL)
+ p = mmap (NULL, num, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ if (p == MAP_FAILED)
return 1;
/* Now unregister it, as if munmap was called. But don't actually munmap, so
we can write into the memory. */
« no previous file with comments | « gcc/libmudflap/testsuite/Makefile.in ('k') | gcc/libssp/Makefile.am » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698