From: Christopher Faulet Date: Fri, 6 Nov 2020 14:19:19 +0000 (+0100) Subject: MINOR: init: Fix the prototype for per-thread free callbacks X-Git-Tag: v2.4-dev1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83fefbcdff9f562d719fcb5da6b4a11e20e13c7c;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/global.h b/include/haproxy/global.h index 23ce305733..feb04c2132 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 2b5aa70656..cdc11a4e5a 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;