diff options
author | Mark Stapp <mjs@voltanet.io> | 2020-07-06 18:55:03 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2020-10-23 14:59:34 +0200 |
commit | b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (patch) | |
tree | b5ef6dcab41d9da516a6ff044056e0faca7b35da /watchfrr/watchfrr.c | |
parent | Merge pull request #7345 from opensourcerouting/bgp-aggr-suppress (diff) | |
download | frr-b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9.tar.xz frr-b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9.zip |
* : 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 <mjs@voltanet.io>
Diffstat (limited to 'watchfrr/watchfrr.c')
-rw-r--r-- | watchfrr/watchfrr.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index af243f7ca..cd5ec6725 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -409,8 +409,8 @@ static void sigchild(void) what = restart->what; restart->pid = 0; gs.numpids--; - thread_cancel(restart->t_kill); - restart->t_kill = NULL; + thread_cancel(&restart->t_kill); + /* Update restart time to reflect the time the command * completed. */ gettimeofday(&restart->time, NULL); @@ -678,8 +678,7 @@ static int handle_read(struct thread *t_read) dmn->name, (long)delay.tv_sec, (long)delay.tv_usec); SET_READ_HANDLER(dmn); - if (dmn->t_wakeup) - thread_cancel(dmn->t_wakeup); + thread_cancel(&dmn->t_wakeup); SET_WAKEUP_ECHO(dmn); return 0; @@ -866,9 +865,8 @@ static int phase_hanging(struct thread *t_hanging) static void set_phase(restart_phase_t new_phase) { gs.phase = new_phase; - if (gs.t_phase_hanging) - thread_cancel(gs.t_phase_hanging); - gs.t_phase_hanging = NULL; + thread_cancel(&gs.t_phase_hanging); + thread_add_timer(master, phase_hanging, NULL, PHASE_TIMEOUT, &gs.t_phase_hanging); } |