summaryrefslogtreecommitdiff
path: root/lib/agentx.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2017-05-10 13:51:47 -0400
committerGitHub <noreply@github.com>2017-05-10 13:51:47 -0400
commit00a1578051ceeb26b0b9c2c3344cac1f202e047d (patch)
tree248b55b1ab56e39025d9902c53564286558eda60 /lib/agentx.c
parent0896b755080b300116d493444bfc05e2ef7ca9f6 (diff)
parentc94671b82f790492ceee226f98a65ad7e7e09967 (diff)
Merge pull request #408 from qlyoung/remove-thread-macros
*: remove THREAD_ON macros, add nullity check
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;
}