diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-05 23:22:25 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-09 22:44:22 +0200 |
commit | 66e78ae64bc4659848517953b365606e3e70e878 (patch) | |
tree | ef1339e397feed2b56b8d653d41c03aa5b2bd94f /zebra/zebra_fpm.c | |
parent | lib: safely check & set thread pointers (diff) | |
download | frr-66e78ae64bc4659848517953b365606e3e70e878.tar.xz frr-66e78ae64bc4659848517953b365606e3e70e878.zip |
*: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See
previous commit message.
To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_fpm.c')
-rw-r--r-- | zebra/zebra_fpm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 281672c9a..e8fa6e116 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -565,9 +565,9 @@ zfpm_conn_up_thread_cb (struct thread *thread) zfpm_g->stats.t_conn_up_yields++; zfpm_rnodes_iter_pause (iter); - zfpm_g->t_conn_up = thread_add_background(zfpm_g->master, - zfpm_conn_up_thread_cb, 0, 0, - NULL); + zfpm_g->t_conn_up = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_up_thread_cb, 0, 0, + &zfpm_g->t_conn_up); return 0; } @@ -599,9 +599,9 @@ zfpm_connection_up (const char *detail) zfpm_rnodes_iter_init (&zfpm_g->t_conn_up_state.iter); zfpm_debug ("Starting conn_up thread"); - zfpm_g->t_conn_up = thread_add_background(zfpm_g->master, - zfpm_conn_up_thread_cb, 0, 0, - NULL); + zfpm_g->t_conn_up = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_up_thread_cb, 0, 0, + &zfpm_g->t_conn_up); zfpm_g->stats.t_conn_up_starts++; } @@ -690,9 +690,9 @@ zfpm_conn_down_thread_cb (struct thread *thread) zfpm_g->stats.t_conn_down_yields++; zfpm_rnodes_iter_pause (iter); - zfpm_g->t_conn_down = thread_add_background(zfpm_g->master, - zfpm_conn_down_thread_cb, 0, - 0, NULL); + zfpm_g->t_conn_down = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_down_thread_cb, 0, 0, + &zfpm_g->t_conn_down); return 0; } @@ -738,9 +738,9 @@ zfpm_connection_down (const char *detail) assert (!zfpm_g->t_conn_down); zfpm_debug ("Starting conn_down thread"); zfpm_rnodes_iter_init (&zfpm_g->t_conn_down_state.iter); - zfpm_g->t_conn_down = thread_add_background(zfpm_g->master, - zfpm_conn_down_thread_cb, 0, 0, - NULL); + zfpm_g->t_conn_down = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_down_thread_cb, 0, 0, + &zfpm_g->t_conn_down); zfpm_g->stats.t_conn_down_starts++; zfpm_set_state (ZFPM_STATE_IDLE, detail); |