summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/vty.c b/lib/vty.c
index fef16f1ee7..5a03514be4 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -776,7 +776,7 @@ static void vty_end_config(struct vty *vty)
vty->cp = 0;
}
-/* Delete a charcter at the current point. */
+/* Delete a character at the current point. */
static void vty_delete_char(struct vty *vty)
{
int i;
@@ -2282,7 +2282,7 @@ static void vty_read_file(struct nb_config *config, FILE *confp)
vty = vty_new();
/* vty_close won't close stderr; if some config command prints
- * something it'll end up there. (not ideal; it'd be beter if output
+ * something it'll end up there. (not ideal; it'd be better if output
* from a file-load went to logging instead. Also note that if this
* function is called after daemonizing, stderr will be /dev/null.)
*
@@ -2697,19 +2697,21 @@ static struct thread_master *vty_master;
static void vty_event_serv(enum event event, int sock)
{
- struct thread *vty_serv_thread = NULL;
+ struct thread **vty_serv_thread_ptr = NULL;
switch (event) {
case VTY_SERV:
- vty_serv_thread = thread_add_read(vty_master, vty_accept,
- NULL, sock, NULL);
- vector_set_index(Vvty_serv_thread, sock, vty_serv_thread);
+ vty_serv_thread_ptr = (struct thread **)vector_get_index(
+ Vvty_serv_thread, sock);
+ thread_add_read(vty_master, vty_accept, NULL, sock,
+ vty_serv_thread_ptr);
break;
#ifdef VTYSH
case VTYSH_SERV:
- vty_serv_thread = thread_add_read(vty_master, vtysh_accept,
- NULL, sock, NULL);
- vector_set_index(Vvty_serv_thread, sock, vty_serv_thread);
+ vty_serv_thread_ptr = (struct thread **)vector_get_index(
+ Vvty_serv_thread, sock);
+ thread_add_read(vty_master, vtysh_accept, NULL, sock,
+ vty_serv_thread_ptr);
break;
#endif /* VTYSH */
default:
@@ -3165,7 +3167,7 @@ void vty_init(struct thread_master *master_thread, bool do_command_logging)
atexit(vty_stdio_atexit);
- /* Initilize server thread vector. */
+ /* Initialize server thread vector. */
Vvty_serv_thread = vector_init(VECTOR_MIN_SIZE);
/* Install bgp top node. */