summaryrefslogtreecommitdiff
path: root/accel-pppd/extra/net-snmp
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:40:13 +0400
commit3125d5c654f4ab79f73d8c3d4120fe3bbf4338f4 (patch)
tree4c7dd762b628d72ca1ed118767400e5c5b545160 /accel-pppd/extra/net-snmp
parente0419f8ff0d1e42eef22eebba561cb91ebf902a0 (diff)
downloadaccel-ppp-3125d5c654f4ab79f73d8c3d4120fe3bbf4338f4.tar.gz
accel-ppp-3125d5c654f4ab79f73d8c3d4120fe3bbf4338f4.zip
snmp: properly terminate snmp thread
Diffstat (limited to 'accel-pppd/extra/net-snmp')
-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 878cd9a7..7e06a79b 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);
}