bgpd: fix using of two pointers for struct thread_master *
bgp is using both bm->master and master pointers interchangebly
for thread manipulation. Since they are the same thing consolidate
to one pointer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index 7c2988c..cacff23 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -105,9 +105,6 @@
/* Route retain mode flag. */
static int retain_mode = 0;
-/* Master of threads. */
-struct thread_master *master;
-
/* Manually specified configuration file name. */
char *config_file = NULL;
@@ -302,8 +299,8 @@
stream_free (bgp_nexthop_buf);
/* reverse bgp_master_init */
- if (master)
- thread_master_free (master);
+ if (bm->master)
+ thread_master_free (bm->master);
if (zlog_default)
closezlog (zlog_default);
@@ -416,15 +413,12 @@
}
}
- /* Make thread master. */
- master = bm->master;
-
/* Initializations. */
srandom (time (NULL));
- signal_init (master, array_size(bgp_signals), bgp_signals);
+ signal_init (bm->master, array_size(bgp_signals), bgp_signals);
zprivs_init (&bgpd_privs);
cmd_init (1);
- vty_init (master);
+ vty_init (bm->master);
memory_init ();
vrf_init ();
@@ -459,7 +453,7 @@
bm->port);
/* Start finite state machine, here we go! */
- while (thread_fetch (master, &thread))
+ while (thread_fetch (bm->master, &thread))
thread_call (&thread);
/* Not reached. */