PATCH: Update libmudflap support for FreeBSD

Andreas Schwab schwab@linux-m68k.org
Fri Aug 21 18:29:00 GMT 2009


Loren James Rittle <rittle@latour.labs.mot.com> writes:

> Index: libmudflap/testsuite/libmudflap.c/pass51-frag.c
> ===================================================================
> --- libmudflap/testsuite/libmudflap.c/pass51-frag.c	(revision 150973)
> +++ libmudflap/testsuite/libmudflap.c/pass51-frag.c	(working copy)
> @@ -13,14 +13,17 @@
>  #ifndef MAP_ANONYMOUS
>  #define MAP_ANONYMOUS MAP_ANON
>  #endif
> +#ifndef MAP_FAILED
> +#define MAP_FAILED NULL
> +#endif
>  #ifdef HAVE_MMAP
>    void *p;
>    unsigned pg = getpagesize ();
>    int rc;
>  
>    p = mmap (NULL, 4 * pg, PROT_READ|PROT_WRITE, 
> -            MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
> -  if (p == NULL)
> +            MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
> +  if (p == MAP_FAILED)

When mmap fails it returns -1, not 0.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc-patches mailing list