summaryrefslogtreecommitdiff
path: root/lib/agentx.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/agentx.c')
-rw-r--r--lib/agentx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index 821c573fb2..4c087219cb 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -118,7 +118,6 @@ static void agentx_events_update(void)
snmp_select_info(&maxfd, &fds, &timeout, &block);
if (!block) {
- timeout_thr = NULL;
thread_add_timer_tv(agentx_tm, agentx_timeout, NULL, &timeout,
&timeout_thr);
}
@@ -147,9 +146,9 @@ static void agentx_events_update(void)
else if (FD_ISSET(fd, &fds)) {
struct listnode *newln;
thr = XCALLOC(MTYPE_TMP, sizeof(struct thread *));
- thread_add_read(agentx_tm, agentx_read, NULL, fd, thr);
+
newln = listnode_add_before(events, ln, thr);
- (*thr)->arg = newln;
+ thread_add_read(agentx_tm, agentx_read, newln, fd, thr);
}
}