From b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Mon, 6 Jul 2020 12:55:03 -0400 Subject: * : update signature of thread_cancel api Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp --- lib/agentx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/agentx.c') diff --git a/lib/agentx.c b/lib/agentx.c index 7c4bdcbe27..07f146bae4 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -130,7 +130,7 @@ static void agentx_events_update(void) if (thr_fd == fd) { struct listnode *nextln = listnextnode(ln); if (!FD_ISSET(fd, &fds)) { - thread_cancel(thr); + thread_cancel(&thr); list_delete_node(events, ln); } ln = nextln; @@ -151,7 +151,8 @@ static void agentx_events_update(void) */ while (ln) { struct listnode *nextln = listnextnode(ln); - thread_cancel(listgetdata(ln)); + thr = listgetdata(ln); + thread_cancel(&thr); list_delete_node(events, ln); ln = nextln; } -- cgit v1.2.3