diff options
Diffstat (limited to 'accel-pptpd/main.c')
-rw-r--r-- | accel-pptpd/main.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/accel-pptpd/main.c b/accel-pptpd/main.c index 147c248..afd6b58 100644 --- a/accel-pptpd/main.c +++ b/accel-pptpd/main.c @@ -14,10 +14,6 @@ static int goto_daemon; static char *pid_file; static char *conf_file; -static void sigterm(int num) -{ -} - #define ARG_MAX 128 static int parse_cmdline(char ***argv) { @@ -87,6 +83,7 @@ usage: int main(int argc, char **argv) { sigset_t set; + int sig; if (triton_load_modules("modules")) return EXIT_FAILURE; @@ -119,21 +116,34 @@ int main(int argc, char **argv) } } - signal(SIGTERM, sigterm); - signal(SIGPIPE, sigterm); - signal(SIGUSR1, sigterm); - + //signal(SIGTERM, sigterm); + //signal(SIGPIPE, sigterm); + triton_run(); - + sigfillset(&set); - sigdelset(&set, SIGINT); - sigdelset(&set, SIGTERM); + sigdelset(&set, SIGKILL); + sigdelset(&set, SIGSTOP); sigdelset(&set, SIGSEGV); - sigdelset(&set, SIGILL); sigdelset(&set, SIGFPE); + sigdelset(&set, SIGILL); sigdelset(&set, SIGBUS); - - sigsuspend(&set); + sigdelset(&set, 35); + sigdelset(&set, 36); + sigdelset(&set, SIGIO); + sigdelset(&set, SIGINT); + pthread_sigmask(SIG_SETMASK, &set, NULL); + + sigemptyset(&set); + //sigaddset(&set, SIGINT); + sigaddset(&set, SIGTERM); + sigaddset(&set, SIGSEGV); + sigaddset(&set, SIGILL); + sigaddset(&set, SIGFPE); + sigaddset(&set, SIGBUS); + + sigwait(&set, &sig); + printf("terminate, sig = %i\n", sig); triton_terminate(); |