summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-10-14 08:50:38 -0400
committerPaul Jakma <paul@quagga.net>2015-10-27 10:53:22 +0000
commiteeef0db2e9260fe76acb328a339025c432eb7c22 (patch)
tree48bc6b2b1e3e71658fcf345ed381d3d4bf10c8c4
parentee162617ead116ebcda93b145a043231647b3380 (diff)
downloadquagga-eeef0db2e9260fe76acb328a339025c432eb7c22.tar.bz2
quagga-eeef0db2e9260fe76acb328a339025c432eb7c22.tar.xz
lib: Fix duplicate variable name in smux.c and vty.c
Both smux.c and vty.c have the same: static struct thread_master *master; as global variables for the file. This can and will lead to confusion name the variables something appropriate for the file it is in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--lib/smux.c10
-rw-r--r--lib/vty.c20
2 files changed, 15 insertions, 15 deletions
diff --git a/lib/smux.c b/lib/smux.c
index 70be4928..03da99f9 100644
--- a/lib/smux.c
+++ b/lib/smux.c
@@ -113,7 +113,7 @@ static struct cmd_node smux_node =
};
/* thread master */
-static struct thread_master *master;
+static struct thread_master *smux_master;
static int
oid_compare_part (oid *o1, int o1_len, oid *o2, int o2_len)
@@ -1239,13 +1239,13 @@ smux_event (enum smux_event event, int sock)
switch (event)
{
case SMUX_SCHEDULE:
- smux_connect_thread = thread_add_event (master, smux_connect, NULL, 0);
+ smux_connect_thread = thread_add_event (smux_master, smux_connect, NULL, 0);
break;
case SMUX_CONNECT:
- smux_connect_thread = thread_add_timer (master, smux_connect, NULL, 10);
+ smux_connect_thread = thread_add_timer (smux_master, smux_connect, NULL, 10);
break;
case SMUX_READ:
- smux_read_thread = thread_add_read (master, smux_read, NULL, sock);
+ smux_read_thread = thread_add_read (smux_master, smux_read, NULL, sock);
break;
default:
break;
@@ -1474,7 +1474,7 @@ void
smux_init (struct thread_master *tm)
{
/* copy callers thread master */
- master = tm;
+ smux_master = tm;
/* Make MIB tree. */
treelist = list_new();
diff --git a/lib/vty.c b/lib/vty.c
index 5c4a23bd..8befcb0f 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2573,7 +2573,7 @@ vty_config_unlock (struct vty *vty)
}
/* Master of the threads. */
-static struct thread_master *master;
+static struct thread_master *vty_master;
static void
vty_event (enum event event, int sock, struct vty *vty)
@@ -2583,23 +2583,23 @@ vty_event (enum event event, int sock, struct vty *vty)
switch (event)
{
case VTY_SERV:
- vty_serv_thread = thread_add_read (master, vty_accept, vty, sock);
+ vty_serv_thread = thread_add_read (vty_master, vty_accept, vty, sock);
vector_set_index (Vvty_serv_thread, sock, vty_serv_thread);
break;
#ifdef VTYSH
case VTYSH_SERV:
- vty_serv_thread = thread_add_read (master, vtysh_accept, vty, sock);
+ vty_serv_thread = thread_add_read (vty_master, vtysh_accept, vty, sock);
vector_set_index (Vvty_serv_thread, sock, vty_serv_thread);
break;
case VTYSH_READ:
- vty->t_read = thread_add_read (master, vtysh_read, vty, sock);
+ vty->t_read = thread_add_read (vty_master, vtysh_read, vty, sock);
break;
case VTYSH_WRITE:
- vty->t_write = thread_add_write (master, vtysh_write, vty, sock);
+ vty->t_write = thread_add_write (vty_master, vtysh_write, vty, sock);
break;
#endif /* VTYSH */
case VTY_READ:
- vty->t_read = thread_add_read (master, vty_read, vty, sock);
+ vty->t_read = thread_add_read (vty_master, vty_read, vty, sock);
/* Time out treatment. */
if (vty->v_timeout)
@@ -2607,12 +2607,12 @@ vty_event (enum event event, int sock, struct vty *vty)
if (vty->t_timeout)
thread_cancel (vty->t_timeout);
vty->t_timeout =
- thread_add_timer (master, vty_timeout, vty, vty->v_timeout);
+ thread_add_timer (vty_master, vty_timeout, vty, vty->v_timeout);
}
break;
case VTY_WRITE:
if (! vty->t_write)
- vty->t_write = thread_add_write (master, vty_flush, vty, sock);
+ vty->t_write = thread_add_write (vty_master, vty_flush, vty, sock);
break;
case VTY_TIMEOUT_RESET:
if (vty->t_timeout)
@@ -2623,7 +2623,7 @@ vty_event (enum event event, int sock, struct vty *vty)
if (vty->v_timeout)
{
vty->t_timeout =
- thread_add_timer (master, vty_timeout, vty, vty->v_timeout);
+ thread_add_timer (vty_master, vty_timeout, vty, vty->v_timeout);
}
break;
}
@@ -3035,7 +3035,7 @@ vty_init (struct thread_master *master_thread)
vtyvec = vector_init (VECTOR_MIN_SIZE);
- master = master_thread;
+ vty_master = master_thread;
atexit (vty_stdio_reset);