summaryrefslogtreecommitdiff
path: root/lib/agentx.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/agentx.c')
-rw-r--r--lib/agentx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index e1d8b54043..5deb8f1e06 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -85,8 +85,11 @@ agentx_events_update(void)
FD_ZERO (&fds);
snmp_select_info (&maxfd, &fds, &timeout, &block);
- if (!block)
- timeout_thr = thread_add_timer_tv (agentx_tm, agentx_timeout, NULL, &timeout);
+ if (!block) {
+ timeout_thr = NULL;
+ thread_add_timer_tv(agentx_tm, agentx_timeout, NULL, &timeout,
+ &timeout_thr);
+ }
ln = listhead (events);
thr = ln ? listgetdata (ln) : NULL;
@@ -114,7 +117,8 @@ agentx_events_update(void)
else if (FD_ISSET (fd, &fds))
{
struct listnode *newln;
- thr = thread_add_read (agentx_tm, agentx_read, NULL, fd);
+ thr = NULL;
+ thread_add_read(agentx_tm, agentx_read, NULL, fd, &thr);
newln = listnode_add_before (events, ln, thr);
thr->arg = newln;
}