summaryrefslogtreecommitdiffstats
path: root/ldpd/accept.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldpd/accept.c')
-rw-r--r--ldpd/accept.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ldpd/accept.c b/ldpd/accept.c
index 5b1dacc30..323558d7f 100644
--- a/ldpd/accept.c
+++ b/ldpd/accept.c
@@ -58,7 +58,8 @@ accept_add(int fd, int (*cb)(struct thread *), void *arg)
av->arg = arg;
LIST_INSERT_HEAD(&accept_queue.queue, av, entry);
- av->ev = thread_add_read(master, accept_cb, av, av->fd, NULL);
+ av->ev = NULL;
+ thread_add_read(master, accept_cb, av, av->fd, &av->ev);
log_debug("%s: accepting on fd %d", __func__, fd);
@@ -85,8 +86,8 @@ accept_pause(void)
{
log_debug(__func__);
accept_unarm();
- accept_queue.evt = thread_add_timer(master, accept_timeout, NULL, 1,
- NULL);
+ accept_queue.evt = NULL;
+ thread_add_timer(master, accept_timeout, NULL, 1, &accept_queue.evt);
}
void
@@ -103,8 +104,10 @@ static void
accept_arm(void)
{
struct accept_ev *av;
- LIST_FOREACH(av, &accept_queue.queue, entry)
- av->ev = thread_add_read(master, accept_cb, av, av->fd, NULL);
+ LIST_FOREACH(av, &accept_queue.queue, entry) {
+ av->ev = NULL;
+ thread_add_read(master, accept_cb, av, av->fd, &av->ev);
+ }
}
static void
@@ -119,7 +122,8 @@ static int
accept_cb(struct thread *thread)
{
struct accept_ev *av = THREAD_ARG(thread);
- av->ev = thread_add_read(master, accept_cb, av, av->fd, NULL);
+ av->ev = NULL;
+ thread_add_read(master, accept_cb, av, av->fd, &av->ev);
av->accept_cb(thread);
return (0);