BUILD: activity/memprofile: fix a build warning in the posix_memalign handler
authorWilly Tarreau <w@1wt.eu>
Fri, 22 Nov 2024 08:41:02 +0000 (09:41 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Jan 2025 14:56:04 +0000 (15:56 +0100)
A "return NULL" statement was placed for error handling in the
posix_memalign() handler instead of an int errno value, by recent
commit 5ddc8b3ad4 ("MINOR: activity/memprofile: monitor non-portable
calls as well"). Surprisingly the warning only triggered on gcc-4.8.
Let's use ENOMEM instead. No backport needed.

(cherry picked from commit b30639848e502f79829abc28c8093aa0e34ba1f9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/activity.c

index 7e783ac..13b3428 100644 (file)
@@ -282,7 +282,7 @@ static int memprof_posix_memalign_initial_handler(void **ptr, size_t al, size_t
 {
        if (in_memprof) {
                /* probably that dlsym() needs posix_memalign(), let's fail */
-               return NULL;
+               return ENOMEM;
        }
 
        memprof_init();