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 23ce305..feb04c2 100644
--- a/include/haproxy/global.h
+++ b/include/haproxy/global.h
@@ -76,7 +76,7 @@
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 2b5aa70..cdc11a4 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -349,7 +349,7 @@
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 @@
}
/* 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;