MEDIUM: initcall: use initcalls for a few initialization functions
signal_init(), init_log(), init_stream(), and init_task() all used to
only preset some values and lists. This needs to be done very early to
provide a reliable interface to all other users. The calls used to be
explicit in haproxy.c:init(). Now they're placed in initcalls at the
STG_PREPARE stage. The functions are not exported anymore.
diff --git a/src/task.c b/src/task.c
index aeb3e4e..1f09f13 100644
--- a/src/task.c
+++ b/src/task.c
@@ -469,8 +469,8 @@
}
}
-/* perform minimal intializations, report 0 in case of error, 1 if OK. */
-int init_task()
+/* perform minimal intializations */
+static void init_task()
{
int i;
@@ -482,9 +482,10 @@
for (i = 0; i < MAX_THREADS; i++) {
LIST_INIT(&task_per_thread[i].task_list);
}
- return 1;
}
+INITCALL0(STG_PREPARE, init_task);
+
/*
* Local variables:
* c-indent-level: 8