From 1d15d34c7ee9d85cff61da2ef6be78fa108230d9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 22 Mar 2021 14:19:02 -0400 Subject: [PATCH] return errors from memory_set_name too --- memory.c | 6 ++++-- memory.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/memory.c b/memory.c index 47060c2..2d995ef 100644 --- a/memory.c +++ b/memory.c @@ -94,8 +94,10 @@ bool memory_purge(void *ptr, size_t size) { return ret; } -void memory_set_name(UNUSED void *ptr, UNUSED size_t size, UNUSED const char *name) { +bool memory_set_name(UNUSED void *ptr, UNUSED size_t size, UNUSED const char *name) { #ifdef LABEL_MEMORY - prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, name); + return prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, name); +#else + return false; #endif } diff --git a/memory.h b/memory.h index b2e77ee..c04bfd9 100644 --- a/memory.h +++ b/memory.h @@ -21,6 +21,6 @@ bool memory_remap(void *old, size_t old_size, size_t new_size); bool memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size); #endif bool memory_purge(void *ptr, size_t size); -void memory_set_name(void *ptr, size_t size, const char *name); +bool memory_set_name(void *ptr, size_t size, const char *name); #endif