gdb/testsuite: check mmap ret val against MAP_FAILED
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 20 May 2020 14:50:39 +0000 (10:50 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 20 May 2020 14:50:50 +0000 (10:50 -0400)
commit41977d16e4ee5b9ad01abf2cfce6edbfb6d79541
tree46af3678d259d1b8b736c473707c5997c34bf0d3
parentb4757f2e45f292c9f0e48e8dbdc003e5dbfca5ed
gdb/testsuite: check mmap ret val against MAP_FAILED

Fixup a few spots in the testsuite that use mmap to consistently check
the return value against MAP_FAILED.

One spot in gdb.base/coredump-filter.c checked against NULL, that is
wrong.  The other spots either didn't check, or checked against -1.
MAP_FAILED has the value -1, at least on Linux, but it's better to check
against the documented define.

gdb/testsuite/ChangeLog:

PR gdb/26016
* gdb.base/coredump-filter.c (do_mmap): Check mmap ret val
against MAP_FAILED.
* gdb.base/coremaker.c (mmapdata): Likewise.
* gdb.base/jit-reader-host.c (main): Likewise.
* gdb.base/sym-file-loader.c (load): Likewise.
(load_shlib): Likewise.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/coredump-filter.c
gdb/testsuite/gdb.base/coremaker.c
gdb/testsuite/gdb.base/jit-reader-host.c
gdb/testsuite/gdb.base/sym-file-loader.c