diff options
| author | Russ White <russ@riw.us> | 2017-05-10 13:51:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-10 13:51:47 -0400 |
| commit | 00a1578051ceeb26b0b9c2c3344cac1f202e047d (patch) | |
| tree | 248b55b1ab56e39025d9902c53564286558eda60 /zebra/rtadv.c | |
| parent | 0896b755080b300116d493444bfc05e2ef7ca9f6 (diff) | |
| parent | c94671b82f790492ceee226f98a65ad7e7e09967 (diff) | |
Merge pull request #408 from qlyoung/remove-thread-macros
*: remove THREAD_ON macros, add nullity check
Diffstat (limited to 'zebra/rtadv.c')
| -rw-r--r-- | zebra/rtadv.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 12e4873adf..03b7ace9b3 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -1574,11 +1574,8 @@ rtadv_event (struct zebra_ns *zns, enum rtadv_event event, int val) switch (event) { case RTADV_START: - if (! rtadv->ra_read) - rtadv->ra_read = thread_add_read (zebrad.master, rtadv_read, zns, val); - if (! rtadv->ra_timer) - rtadv->ra_timer = thread_add_event (zebrad.master, rtadv_timer, - zns, 0); + thread_add_read(zebrad.master, rtadv_read, zns, val, &rtadv->ra_read); + thread_add_event(zebrad.master, rtadv_timer, zns, 0, &rtadv->ra_timer); break; case RTADV_STOP: if (rtadv->ra_timer) @@ -1593,18 +1590,14 @@ rtadv_event (struct zebra_ns *zns, enum rtadv_event event, int val) } break; case RTADV_TIMER: - if (! rtadv->ra_timer) - rtadv->ra_timer = thread_add_timer (zebrad.master, rtadv_timer, zns, - val); + thread_add_timer(zebrad.master, rtadv_timer, zns, val, &rtadv->ra_timer); break; case RTADV_TIMER_MSEC: - if (! rtadv->ra_timer) - rtadv->ra_timer = thread_add_timer_msec (zebrad.master, rtadv_timer, - zns, val); + thread_add_timer_msec(zebrad.master, rtadv_timer, zns, val, + &rtadv->ra_timer); break; case RTADV_READ: - if (! rtadv->ra_read) - rtadv->ra_read = thread_add_read (zebrad.master, rtadv_read, zns, val); + thread_add_read(zebrad.master, rtadv_read, zns, val, &rtadv->ra_read); break; default: break; |
