mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-09 11:41:00 +01:00
REORG: mworker: move signals functions to mworker.c
Move the following functions to mworker.c: void mworker_block_signals(); void mworker_unblock_signals();
This commit is contained in:
parent
48dfbbdea9
commit
3cd95d2f1b
@ -16,4 +16,8 @@
|
||||
void mworker_proc_list_to_env();
|
||||
void mworker_env_to_proc_list();
|
||||
|
||||
|
||||
void mworker_block_signals();
|
||||
void mworker_unblock_signals();
|
||||
|
||||
#endif /* PROTO_MWORKER_H_ */
|
||||
|
||||
@ -511,23 +511,6 @@ int current_child(int pid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mworker_block_signals()
|
||||
{
|
||||
sigset_t set;
|
||||
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIGUSR1);
|
||||
sigaddset(&set, SIGUSR2);
|
||||
sigaddset(&set, SIGHUP);
|
||||
sigaddset(&set, SIGCHLD);
|
||||
ha_sigmask(SIG_SETMASK, &set, NULL);
|
||||
}
|
||||
|
||||
static void mworker_unblock_signals()
|
||||
{
|
||||
haproxy_unblock_signals();
|
||||
}
|
||||
|
||||
/*
|
||||
* Send signal to every known children.
|
||||
*/
|
||||
|
||||
@ -16,11 +16,11 @@
|
||||
#include <common/mini-clist.h>
|
||||
|
||||
#include <proto/mworker.h>
|
||||
#include <proto/signal.h>
|
||||
|
||||
#include <types/global.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* serialize the proc list and put it in the environment
|
||||
*/
|
||||
@ -86,3 +86,22 @@ void mworker_env_to_proc_list()
|
||||
|
||||
unsetenv("HAPROXY_PROCESSES");
|
||||
}
|
||||
|
||||
/* Signal blocking and unblocking */
|
||||
|
||||
void mworker_block_signals()
|
||||
{
|
||||
sigset_t set;
|
||||
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIGUSR1);
|
||||
sigaddset(&set, SIGUSR2);
|
||||
sigaddset(&set, SIGHUP);
|
||||
sigaddset(&set, SIGCHLD);
|
||||
ha_sigmask(SIG_SETMASK, &set, NULL);
|
||||
}
|
||||
|
||||
void mworker_unblock_signals()
|
||||
{
|
||||
haproxy_unblock_signals();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user