mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-27 11:47:38 +00:00
Block all signals in daemon
This commit is contained in:
parent
71ecbb3af3
commit
8a5b6f2b86
@ -134,19 +134,11 @@ static void main_daemon() {
|
|||||||
// Change process name
|
// Change process name
|
||||||
strcpy(argv0, "magiskd");
|
strcpy(argv0, "magiskd");
|
||||||
|
|
||||||
// Block all user signals
|
// Block all signals
|
||||||
sigset_t block_set;
|
sigset_t block_set;
|
||||||
sigemptyset(&block_set);
|
sigfillset(&block_set);
|
||||||
sigaddset(&block_set, SIGUSR1);
|
|
||||||
sigaddset(&block_set, SIGUSR2);
|
|
||||||
pthread_sigmask(SIG_SETMASK, &block_set, nullptr);
|
pthread_sigmask(SIG_SETMASK, &block_set, nullptr);
|
||||||
|
|
||||||
// Ignore SIGPIPE
|
|
||||||
struct sigaction act;
|
|
||||||
memset(&act, 0, sizeof(act));
|
|
||||||
act.sa_handler = SIG_IGN;
|
|
||||||
sigaction(SIGPIPE, &act, nullptr);
|
|
||||||
|
|
||||||
// Loop forever to listen for requests
|
// Loop forever to listen for requests
|
||||||
while(true) {
|
while(true) {
|
||||||
int *client = new int;
|
int *client = new int;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user