mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUILD: pollers: use an initcall to register the pollers
Pollers are among the few remaining blocks still using constructors to register themselves. That's not needed anymore since the initcalls so better turn to initcalls.
This commit is contained in:
parent
2df1fbf816
commit
740d749d77
@ -357,11 +357,8 @@ static int _do_fork(struct poller *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is a constructor, which means that it will automatically be called before
|
* Registers the poller.
|
||||||
* main(). This is GCC-specific but it works at least since 2.95.
|
|
||||||
* Special care must be taken so that it does not need any uninitialized data.
|
|
||||||
*/
|
*/
|
||||||
__attribute__((constructor))
|
|
||||||
static void _do_register(void)
|
static void _do_register(void)
|
||||||
{
|
{
|
||||||
struct poller *p;
|
struct poller *p;
|
||||||
@ -388,6 +385,8 @@ static void _do_register(void)
|
|||||||
p->fork = _do_fork;
|
p->fork = _do_fork;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INITCALL0(STG_REGISTER, _do_register);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
|
@ -402,10 +402,8 @@ static int _do_fork(struct poller *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This constructor must be called before main() to register the event ports
|
* Registers the poller.
|
||||||
* poller.
|
|
||||||
*/
|
*/
|
||||||
__attribute__((constructor))
|
|
||||||
static void _do_register(void)
|
static void _do_register(void)
|
||||||
{
|
{
|
||||||
struct poller *p;
|
struct poller *p;
|
||||||
@ -431,3 +429,5 @@ static void _do_register(void)
|
|||||||
p->poll = _do_poll;
|
p->poll = _do_poll;
|
||||||
p->fork = _do_fork;
|
p->fork = _do_fork;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INITCALL0(STG_REGISTER, _do_register);
|
||||||
|
@ -336,11 +336,8 @@ static int _do_fork(struct poller *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is a constructor, which means that it will automatically be called before
|
* Registers the poller.
|
||||||
* main(). This is GCC-specific but it works at least since 2.95.
|
|
||||||
* Special care must be taken so that it does not need any uninitialized data.
|
|
||||||
*/
|
*/
|
||||||
__attribute__((constructor))
|
|
||||||
static void _do_register(void)
|
static void _do_register(void)
|
||||||
{
|
{
|
||||||
struct poller *p;
|
struct poller *p;
|
||||||
@ -367,6 +364,7 @@ static void _do_register(void)
|
|||||||
p->fork = _do_fork;
|
p->fork = _do_fork;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INITCALL0(STG_REGISTER, _do_register);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
|
@ -316,11 +316,8 @@ static int _do_test(struct poller *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is a constructor, which means that it will automatically be called before
|
* Registers the poller.
|
||||||
* main(). This is GCC-specific but it works at least since 2.95.
|
|
||||||
* Special care must be taken so that it does not need any uninitialized data.
|
|
||||||
*/
|
*/
|
||||||
__attribute__((constructor))
|
|
||||||
static void _do_register(void)
|
static void _do_register(void)
|
||||||
{
|
{
|
||||||
struct poller *p;
|
struct poller *p;
|
||||||
@ -341,6 +338,7 @@ static void _do_register(void)
|
|||||||
p->poll = _do_poll;
|
p->poll = _do_poll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INITCALL0(STG_REGISTER, _do_register);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
|
@ -300,11 +300,8 @@ static int _do_test(struct poller *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is a constructor, which means that it will automatically be called before
|
* Registers the poller.
|
||||||
* main(). This is GCC-specific but it works at least since 2.95.
|
|
||||||
* Special care must be taken so that it does not need any uninitialized data.
|
|
||||||
*/
|
*/
|
||||||
__attribute__((constructor))
|
|
||||||
static void _do_register(void)
|
static void _do_register(void)
|
||||||
{
|
{
|
||||||
struct poller *p;
|
struct poller *p;
|
||||||
@ -325,6 +322,7 @@ static void _do_register(void)
|
|||||||
p->poll = _do_poll;
|
p->poll = _do_poll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INITCALL0(STG_REGISTER, _do_register);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
|
Loading…
Reference in New Issue
Block a user