summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-09-03 16:40:13 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-09-03 16:41:22 +0400
commit7844d8e3d12e5e4c2ffbd1d1fb477970d2743696 (patch)
tree3f614425e7aa1ce5021baa0e62b5d8447241bbab
parent19e92f6c58d1e225404337448e72f7c9c7cf2a4d (diff)
downloadaccel-ppp-7844d8e3d12e5e4c2ffbd1d1fb477970d2743696.tar.gz
accel-ppp-7844d8e3d12e5e4c2ffbd1d1fb477970d2743696.zip
snmp: properly terminate snmp thread
-rw-r--r--accel-pppd/extra/net-snmp/agent.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/accel-pppd/extra/net-snmp/agent.c b/accel-pppd/extra/net-snmp/agent.c
index 878cd9a..7e06a79 100644
--- a/accel-pppd/extra/net-snmp/agent.c
+++ b/accel-pppd/extra/net-snmp/agent.c
@@ -76,6 +76,7 @@ static void *snmp_thread(void *a)
sigfillset(&set);
sigdelset(&set, SIGKILL);
sigdelset(&set, SIGSTOP);
+ sigdelset(&set, 32);
pthread_sigmask(SIG_BLOCK, &set, NULL);
snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_LOGGING, agent_log, NULL);
@@ -118,7 +119,8 @@ static void *snmp_thread(void *a)
static void snmp_ctx_close(struct triton_context_t *ctx)
{
snmp_term = 1;
- snmp_shutdown(conf_agent_name);
+ pthread_cancel(snmp_thr);
+ pthread_join(snmp_thr, NULL);
triton_context_unregister(ctx);
}