diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-05-10 20:06:03 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-05-10 20:06:10 +0200 |
commit | 0727463965a8929419e4152d259977c88922fa2a (patch) | |
tree | e85785b8ff020b7471434d222bbfa85bb446144e /tests/slow/hash-large.c | |
parent | 89f5f9b4a81ee4cc04ca5a37887c15368395670f (diff) | |
download | gnutls-0727463965a8929419e4152d259977c88922fa2a.tar.gz |
tests: fix mmap usage of hash-large to correctly detect failures
Diffstat (limited to 'tests/slow/hash-large.c')
-rw-r--r-- | tests/slow/hash-large.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/slow/hash-large.c b/tests/slow/hash-large.c index baca0baa76..724ee4af0b 100644 --- a/tests/slow/hash-large.c +++ b/tests/slow/hash-large.c @@ -48,8 +48,12 @@ static void exit_77(int signo) static size_t _mmap_size; static void *get_mem(size_t size) { + void *p; _mmap_size = size; - return mmap(NULL, size, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + p = mmap(NULL, size, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + if (p == MAP_FAILED) + return NULL; + return p; } static void put_mem(void *mem) |