]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR other/67457
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Sep 2015 13:49:19 +0000 (13:49 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Sep 2015 13:49:19 +0000 (13:49 +0000)
* mmap.c (backtrace_alloc): Correct test for mmap failure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227529 138bc75d-0d04-0410-961f-82ee72b054a4

libbacktrace/ChangeLog
libbacktrace/mmap.c

index f44a73d7cc0926a1bb0bd98cdc42aa0db684b349..92ec7a13c4ad2d8e6f6c8cbf0208ef939eb9e0ee 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-08  Ian Lance Taylor  <iant@google.com>
+
+       PR other/67457
+       * mmap.c (backtrace_alloc): Correct test for mmap failure.
+
 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * configure.ac: For spu-*-* targets, set have_fcntl to no.
index 1ecf131191142879ca808b864eb47810a71c5bbe..47c564f13f81ff4ca1b5393420e10c248d8f5f0d 100644 (file)
@@ -139,7 +139,7 @@ backtrace_alloc (struct backtrace_state *state,
       asksize = (size + pagesize - 1) & ~ (pagesize - 1);
       page = mmap (NULL, asksize, PROT_READ | PROT_WRITE,
                   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-      if (page == NULL)
+      if (page == MAP_FAILED)
        error_callback (data, "mmap", errno);
       else
        {