From c1d5ae9a2551a1873289f8b85b61cc78872426cd Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Wed, 14 Dec 2016 17:04:09 +0000 Subject: [PATCH] set event id in add_event rather than calling function --- src/extension/default_eventloop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/extension/default_eventloop.c b/src/extension/default_eventloop.c index 72fd51ec..9b81f15d 100644 --- a/src/extension/default_eventloop.c +++ b/src/extension/default_eventloop.c @@ -47,6 +47,7 @@ _getdns_eventloop_info *find_event(_getdns_eventloop_info** events, int id) void add_event(_getdns_eventloop_info** events, int id, _getdns_eventloop_info* ev) { DEBUG_SCHED("default_eventloop: add_event with id %d", id); + ev->id = id; HASH_ADD_INT(*events, id, ev); } @@ -115,7 +116,6 @@ default_eventloop_schedule(getdns_eventloop *loop, free(fd_event); } fd_event = calloc(1, sizeof(_getdns_eventloop_info)); - fd_event->id = fd; fd_event->event = event; fd_event->timeout_time = get_now_plus(timeout); add_event(&default_loop->fd_events, fd, fd_event); @@ -140,7 +140,6 @@ default_eventloop_schedule(getdns_eventloop *loop, _getdns_eventloop_info* timeout_event = NULL; if ((timeout_event = find_event(&default_loop->timeout_events, i)) == NULL) { timeout_event = calloc(1, sizeof(_getdns_eventloop_info)); - timeout_event->id = i; timeout_event->event = event; timeout_event->timeout_time = get_now_plus(timeout); add_event(&default_loop->timeout_events, i, timeout_event);