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 /lib/vty.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 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -2618,36 +2618,41 @@ vty_event (enum event event, int sock, struct vty *vty) switch (event) { case VTY_SERV: - vty_serv_thread = thread_add_read (vty_master, vty_accept, vty, sock); + vty_serv_thread = NULL; + thread_add_read(vty_master, vty_accept, vty, sock, &vty_serv_thread); vector_set_index (Vvty_serv_thread, sock, vty_serv_thread); break; #ifdef VTYSH case VTYSH_SERV: - vty_serv_thread = thread_add_read (vty_master, vtysh_accept, vty, sock); + vty_serv_thread = NULL; + thread_add_read(vty_master, vtysh_accept, vty, sock, &vty_serv_thread); vector_set_index (Vvty_serv_thread, sock, vty_serv_thread); break; case VTYSH_READ: - vty->t_read = thread_add_read (vty_master, vtysh_read, vty, sock); + vty->t_read = NULL; + thread_add_read(vty_master, vtysh_read, vty, sock, &vty->t_read); break; case VTYSH_WRITE: - vty->t_write = thread_add_write (vty_master, vtysh_write, vty, sock); + vty->t_write = NULL; + thread_add_write(vty_master, vtysh_write, vty, sock, &vty->t_write); break; #endif /* VTYSH */ case VTY_READ: - vty->t_read = thread_add_read (vty_master, vty_read, vty, sock); + vty->t_read = NULL; + thread_add_read(vty_master, vty_read, vty, sock, &vty->t_read); /* Time out treatment. */ if (vty->v_timeout) { if (vty->t_timeout) thread_cancel (vty->t_timeout); - vty->t_timeout = - thread_add_timer (vty_master, vty_timeout, vty, vty->v_timeout); + vty->t_timeout = NULL; + thread_add_timer(vty_master, vty_timeout, vty, vty->v_timeout, + &vty->t_timeout); } break; case VTY_WRITE: - if (! vty->t_write) - vty->t_write = thread_add_write (vty_master, vty_flush, vty, sock); + thread_add_write(vty_master, vty_flush, vty, sock, &vty->t_write); break; case VTY_TIMEOUT_RESET: if (vty->t_timeout) @@ -2657,8 +2662,9 @@ vty_event (enum event event, int sock, struct vty *vty) } if (vty->v_timeout) { - vty->t_timeout = - thread_add_timer (vty_master, vty_timeout, vty, vty->v_timeout); + vty->t_timeout = NULL; + thread_add_timer(vty_master, vty_timeout, vty, vty->v_timeout, + &vty->t_timeout); } break; } |
