From 83fefbcdff9f562d719fcb5da6b4a11e20e13c7c Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 6 Nov 2020 15:19:19 +0100 Subject: [PATCH] MINOR: init: Fix the prototype for per-thread free callbacks Functions registered to release memory per-thread have no return value. But the registering function and the function pointer in per_thread_free_fct structure specify it should return an integer. This patch fixes it. This patch may be backported as far as 2.0. --- include/haproxy/global.h | 2 +- src/haproxy.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/haproxy/global.h b/include/haproxy/global.h index 23ce30573..feb04c213 100644 --- a/include/haproxy/global.h +++ b/include/haproxy/global.h @@ -76,7 +76,7 @@ void hap_register_server_deinit(void (*fct)(struct server *)); void hap_register_per_thread_alloc(int (*fct)()); void hap_register_per_thread_init(int (*fct)()); void hap_register_per_thread_deinit(void (*fct)()); -void hap_register_per_thread_free(int (*fct)()); +void hap_register_per_thread_free(void (*fct)()); void mworker_accept_wrapper(int fd); void mworker_reload(); diff --git a/src/haproxy.c b/src/haproxy.c index 2b5aa7065..cdc11a4e5 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -349,7 +349,7 @@ struct server_deinit_fct { struct list per_thread_free_list = LIST_HEAD_INIT(per_thread_free_list); struct per_thread_free_fct { struct list list; - int (*fct)(); + void (*fct)(); }; /* These functions are called for each thread just after the scheduler loop and @@ -521,7 +521,7 @@ void hap_register_per_thread_deinit(void (*fct)()) } /* used to register some free functions to call for each thread. */ -void hap_register_per_thread_free(int (*fct)()) +void hap_register_per_thread_free(void (*fct)()) { struct per_thread_free_fct *b;