]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
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)
committerWilly Tarreau <w@1wt.eu>
Fri, 22 Nov 2024 08:42:49 +0000 (09:42 +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.

src/activity.c

index 0aa1027e864463b62c2e265b2726c580f62b68c0..64ec5de93cb3529607f7dc5504428eb8f0eb33f9 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();