]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: init: Fix the prototype for per-thread free callbacks
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Nov 2020 14:19:19 +0000 (15:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Nov 2020 15:26:10 +0000 (16:26 +0100)
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
src/haproxy.c

index 23ce3057336945587033035739a0ab6a3b642beb..feb04c21324a08a9c10b6789eb586196ad23efe5 100644 (file)
@@ -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();
index 2b5aa706560229200c8c9354e204cd0c8b7f2f1b..cdc11a4e5a430999b172c27ea4f958714e63ef18 100644 (file)
@@ -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;