summaryrefslogtreecommitdiffstats
path: root/watchfrr/watchfrr.c
diff options
context:
space:
mode:
Diffstat (limited to 'watchfrr/watchfrr.c')
-rw-r--r--watchfrr/watchfrr.c12
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);
}